Java mean mean(double[] array)

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

Description

mean

License

Open Source License

Declaration

public static double mean(double[] array) 

Method Source Code

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

public class Main {
    public static double mean(double[] array) {
        if (array.length == 0)
            throw new IllegalArgumentException("length cannot be 0.");
        double sum = 0;
        for (double d : array) {
            sum += d;//from  w  w  w .  j a  v a 2  s. c o m
        }
        return sum / array.length;
    }
}

Related

  1. mean(double[] a, int n)
  2. mean(double[] aArray)
  3. mean(double[] an)
  4. mean(double[] arr)
  5. mean(Double[] array)
  6. mean(double[] data)
  7. mean(double[] data)
  8. mean(double[] doubleArray)
  9. mean(double[] list)