From 8000ca18a589ccf677010213b931aa0de54720f1 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Sat, 29 Apr 2023 23:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xyz/zhouxy/plusone/commons/util/NumberUtil.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/zhouxy/plusone/commons/util/NumberUtil.java b/src/main/java/xyz/zhouxy/plusone/commons/util/NumberUtil.java index 1395050..7d8a9a4 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/util/NumberUtil.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/util/NumberUtil.java @@ -36,7 +36,7 @@ public class NumberUtil { } public static long sum(final int... numbers) { - int result = 0; + long result = 0L; for (int number : numbers) { result += number; } @@ -44,7 +44,7 @@ public class NumberUtil { } public static long sum(final long... numbers) { - long result = 0; + long result = 0L; for (long number : numbers) { result += number; } @@ -52,15 +52,15 @@ public class NumberUtil { } public static double sum(final float... numbers) { - double result = 0; - for (double number : numbers) { + double result = 0.00; + for (float number : numbers) { result += number; } return result; } public static double sum(final double... numbers) { - double result = 0; + double result = 0.00; for (double number : numbers) { result += number; }