Java List Mean mean(double[] list)

Here you can find the source of mean(double[] list)

Description

mean

License

Apache License

Declaration

public static double mean(double[] list) 

Method Source Code

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

import java.util.List;

public class Main {
    public static double mean(double[] list) {
        return sum(list) / list.length;
    }//  w  w  w  . j  a  va2 s .c  o  m

    public static int sum(int[] list) {
        int sum = 0;
        for (int x : list)
            sum += x;
        return sum;
    }

    public static double sum(double[] list) {
        double sum = 0;
        for (double x : list)
            sum += x;
        return sum;
    }

    public static double sum(double[][] list) {
        double sum = 0;
        for (double[] x : list)
            sum += sum(x);
        return sum;
    }

    public static double sum(List<Double> list) {
        double sum = 0;
        for (double x : list)
            sum += x;
        return sum;
    }
}

Related

  1. getMean(List data)
  2. getMean(List list)
  3. getStandardDeviation(double meanValue, List values)
  4. getStandardDeviation(List doubles, Double mean)
  5. getStandardDeviationOfMean(List doubles)
  6. mean(final List list)
  7. mean(List data)
  8. mean(List nums, int start, int size)
  9. mean(List data)