Java Array Average avg(double[] array)

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

Description

avg

License

Open Source License

Declaration

public static double avg(double[] array) 

Method Source Code

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

public class Main {
    public static double avg(double[] array) {
        double sum = 0;
        for (double val : array) {
            sum += val;
        }/*from w  w  w . ja va 2  s.  c o m*/
        return sum / array.length;
    }
}

Related

  1. avg(double a, double b)
  2. avg(double v1, double v2)
  3. avg(double values[], int size, boolean ignoreNan)
  4. avg(double... a)
  5. avg(double[] a)
  6. avg(double[] nums)
  7. avg(double[] values)
  8. avg(double[] values)
  9. avg(double[] x, int start, int end)