Java Array Average average(final float[] values)

Here you can find the source of average(final float[] values)

Description

average

License

Open Source License

Declaration

public static float average(final float[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static float average(final float[] values) {
        final double size = values.length;
        double avg = 0;

        for (final float v : values)
            avg += v / size;//from  w  ww.  j  a v  a 2  s .  c  o m

        return (float) avg;
    }

    public static double average(final double[] values) {
        final double size = values.length;
        double avg = 0;

        for (final double v : values)
            avg += v / size;

        return avg;
    }
}

Related

  1. average(double[] values)
  2. average(double[] values)
  3. average(double[] values)
  4. average(final double[] values)
  5. average(final Float... values)
  6. average(final int totalAmount, final int orderCount)
  7. average(final T p_num1, final T p_num2)
  8. average(float[][] data, int startIndex, int endIndex)
  9. average(float[][] originalValues, float[][] newValues, int[] indexArray)