Java mean mean(double[] list)

Here you can find the source of mean(double[] list)

Description

mean

License

Open Source License

Declaration

public static double mean(double[] list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static double mean(double[] list) {
        return sum(list) / list.length;
    }//from  w w  w  .  j a v a 2s .  com

    public static int sum(int[] list) {
        int sum = 0;
        for (int x : list)
            sum += x;
        return sum;
    }

    public static double sum(double[] list) {
        double sum = 0;
        for (double x : list)
            sum += x;
        return sum;
    }

    public static double sum(double[][] list) {
        double sum = 0;
        for (double[] x : list)
            sum += sum(x);
        return sum;
    }

    public static double sum(List<Double> list) {
        double sum = 0;
        for (double x : list)
            sum += x;
        return sum;
    }
}

Related

  1. mean(double[] array)
  2. mean(Double[] array)
  3. mean(double[] data)
  4. mean(double[] data)
  5. mean(double[] doubleArray)
  6. mean(double[] nums)
  7. mean(double[] samples)
  8. mean(double[] series)
  9. mean(double[] v)