Here you can find the source of mean(double[] a)
public static double mean(double[] a)
//package com.java2s; public class Main { public static double mean(double[] a) { return mean(a, 0, a.length); }/*from w ww .j a va 2 s . c om*/ public static double mean(double[] a, int from, int to) { double mean = 0.0; for (int i = from; i < to; i++) { mean += a[i]; } return mean / (to - from); } }