List of utility methods to do Array Average
double | avg(double[] values) avg if (values.length > 0) { return sum(values) / values.length; } else { return 0.0; |
double | avg(double[] x, int start, int end) avg if (start >= end) { return 0; return sum(x, start, end) / (end - start); |
double | avg(final double a, final double b) avg return (a + b) / 2d;
|
double | avg(final double... values) avg return sum(values) / values.length;
|
float | avg(float... numbers) avg return sum(numbers) / numbers.length;
|
double | avg(int... values) Calculate the average of the values from the specified array. long s = sum(values); return ((double) s / values.length); |
float | avg(int[] arr) AVG all elements of the specified primitive type array. return (float) sum(arr) / arr.length; |
int | avg(int[] values) avg if (values == null || values.length == 0) { return 0; return sum(values) / values.length; |
double | avg(int[] xs) avg if (xs.length == 0) return 0.0; else return ((double) sum(xs)) / xs.length; |
double[] | avg(int[][] values) avg int max = 0; for (int i = 0; i < values.length; i++) { if (values[i].length > max) { max = values[i].length; double[] avg = new double[max]; for (int i = 0; i < avg.length; i++) { ... |