Looly 5 years ago
parent
commit
086f3a2e77
2 changed files with 2 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@
 
 ### 新特性
 ### Bug修复
+* 【core   】     修复NumberUtil.partValue有余数问题(issue#I1KX66@Gitee)
 
 -------------------------------------------------------------------------------------------------------------
 ## 5.3.8 (2020-06-16)

+ 1 - 1
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java

@@ -2114,7 +2114,7 @@ public class NumberUtil {
 	 */
 	public static int partValue(int total, int partCount, boolean isPlusOneWhenHasRem) {
 		int partValue = total / partCount;
-		if (isPlusOneWhenHasRem && total % partCount == 0) {
+		if (isPlusOneWhenHasRem && total % partCount > 0) {
 			partValue++;
 		}
 		return partValue;