List of utility methods to do Number Sum
double | sum(double a, double b) Make sum of two double values. return a + b;
|
double | sum(double start, double end, double step) sum if (start > end) { throw new IllegalArgumentException("Lower limit > upper limit!"); } else if (start + step > end) { throw new IllegalArgumentException("Lower limit + step > upper limit!"); } else if (step <= 0) { throw new IllegalArgumentException("Step = 0!"); } else if (start == end) { return start; ... |
double | sum(double x, double y) Calculates sum of two doubles, but treats NaNs as zeros. return Double.isNaN(x) ? y : Double.isNaN(y) ? x : x + y;
|
double | sum(double x, double y) sum return Double.isNaN(x) ? y : Double.isNaN(y) ? x : x + y;
|
double | sum(final Iterable Calculates the sum of a Collection double sum = 0; for (final Double element : values) { sum += element; return sum; |
long | sum(final Iterable sum long res = 0; for (final long n : ns) { res += n; return res; |
int | sum(int a, int b) sum return a + b;
|
int | sum(int matrix1, int matrix2) sum return matrix1 ^ matrix2;
|
double | sum(Iterable The sum of a sequence of floating-point numbers double sum = 0; for (double a : as) { sum += a; return sum; |
int | sum(Iterable sum int sum = 0; for (int i : iterable) { sum += i; return sum; |