Java Array Average average(double[] a)

Here you can find the source of average(double[] a)

Description

average

License

Open Source License

Declaration

public static double average(double[] a) 

Method Source Code

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

public class Main {
    public static double average(double[] a) {
        return sum(a) / a.length;
    }// w w  w  .  j  a  v a 2  s. co  m

    public static double sum(double[] a) {
        double s = 0.0;
        for (double v : a) {
            s += v;
        }
        return s;
    }
}

Related

  1. average(double x, double y)
  2. average(double x1, double x2)
  3. average(double... args)
  4. average(double... vals)
  5. average(double[] a)
  6. average(Double[] arr)
  7. average(double[] array)
  8. average(double[] array)
  9. average(double[] d)