Android examples for java.lang:array calculation
computes the mean of a passed double array
//package com.java2s; public class Main { /**//from w w w . ja va2 s . c o m * computes the mean of a passed double array * @param _arr the array to compute the mean from * @return the mean of the passed double array */ public static double mean(double[] _arr) { double sum = 0; for (double d : _arr) { sum += d; } return sum / _arr.length; } }