Here you can find the source of mean(double[] list)
public static double mean(double[] list)
//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; } }