Here you can find the source of mean(final List
Parameter | Description |
---|---|
list | the list |
public static double mean(final List<Double> list)
//package com.java2s; /*/*from www. j av a 2s .co m*/ * Title: CloudSim Toolkit * Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2009-2012, The University of Melbourne, Australia */ import java.util.List; public class Main { /** * Gets the average. * * @param list the list * * @return the average */ public static double mean(final List<Double> list) { double sum = 0; for (Double number : list) { sum += number; } return sum / list.size(); } }