Here you can find the source of avg(double[] array)
public static double avg(double[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static double avg(double[] array) { double sum = 0; for (double val : array) { sum += val; }/*from w w w . ja va 2 s. c o m*/ return sum / array.length; } }