Java Array Min Value min_max_mean_stddev(long[] counts)

Here you can find the source of min_max_mean_stddev(long[] counts)

Description

mimameastddev

License

Apache License

Declaration

public static double[] min_max_mean_stddev(long[] counts) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double[] min_max_mean_stddev(long[] counts) {
        double min = Float.MAX_VALUE;
        double max = Float.MIN_VALUE;
        double mean = 0;
        for (long tmp : counts) {
            min = Math.min(tmp, min);
            max = Math.max(tmp, max);
            mean += tmp;/*from  ww w  . ja  va2  s  .  c  om*/
        }
        mean /= counts.length;
        double stddev = 0;
        for (long tmp : counts) {
            stddev += Math.pow(tmp - mean, 2);
        }
        stddev /= counts.length;
        stddev = Math.sqrt(stddev);
        return new double[] { min, max, mean, stddev };
    }
}

Related

  1. min(Number[] array)
  2. min(T first, T... others)
  3. min(T... values)
  4. min(T[] args)
  5. min(T[] inputArray, int i, int i0)
  6. min_of_ints(int[] data)
  7. minAndMaxOfArray(float[] array)
  8. minarr(double[] a)
  9. minArray(int[] arr)