Here you can find the source of mean(double[] a)
Parameter | Description |
---|---|
a | the array |
public static double mean(double[] a)
//package com.java2s; public class Main { /**/*from w w w .j a va 2s.co m*/ * computes the mean of a double array * @param a the array * @return the mean */ public static double mean(double[] a) { double sum = 0; for (int i = 0; i < a.length; i++) { sum += a[i]; } return sum / (double) a.length; } }