Here you can find the source of mean(double[] nums)
public static double mean(double[] nums)
//package com.java2s; //License from project: LGPL public class Main { public static double mean(double[] nums) { double s = 0; for (double n : nums) { s += n;/* w ww . ja va 2 s.c o m*/ } return s / nums.length; } }