diff --git a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java b/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java index 8c9c1cd02..a49b425c4 100755 --- a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java @@ -2297,7 +2297,7 @@ public class NumberUtil { * @since 3.0.6 */ public static int count(int total, int part) { - return (total % part == 0) ? (total / part) : (total / part + 1); + return total == 0 ? 0 : (total - 1) / part + 1; } /**