修复错误。

feature/net-util
ZhouXY108 2023-04-29 23:56:12 +08:00
parent eae16c395f
commit 8000ca18a5
1 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ public class NumberUtil {
} }
public static long sum(final int... numbers) { public static long sum(final int... numbers) {
int result = 0; long result = 0L;
for (int number : numbers) { for (int number : numbers) {
result += number; result += number;
} }
@ -44,7 +44,7 @@ public class NumberUtil {
} }
public static long sum(final long... numbers) { public static long sum(final long... numbers) {
long result = 0; long result = 0L;
for (long number : numbers) { for (long number : numbers) {
result += number; result += number;
} }
@ -52,15 +52,15 @@ public class NumberUtil {
} }
public static double sum(final float... numbers) { public static double sum(final float... numbers) {
double result = 0; double result = 0.00;
for (double number : numbers) { for (float number : numbers) {
result += number; result += number;
} }
return result; return result;
} }
public static double sum(final double... numbers) { public static double sum(final double... numbers) {
double result = 0; double result = 0.00;
for (double number : numbers) { for (double number : numbers) {
result += number; result += number;
} }