Java mean mean(int[] values)

Here you can find the source of mean(int[] values)

Description

Returns the average of the values.

License

Open Source License

Parameter

Parameter Description
values The array of integers

Return

The mean of the values

Declaration

public static int mean(int[] values) 

Method Source Code

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

public class Main {
    /**/*  w  w w  .  jav a  2  s . co  m*/
     * Returns the average of the values.
     *
     * @param values The array of integers
     * @return The mean of the values
     */
    public static int mean(int[] values) {
        int result = 0;

        for (int value : values) {
            result += value;
        }

        result /= values.length;
        return result;
    }
}

Related

  1. mean(int low, int high)
  2. mean(int N, int D, double dat[][], double mu[])
  3. mean(int... values)
  4. mean(int[] array)
  5. mean(int[] input)
  6. mean(int[] values, int max)
  7. mean(Integer[] values)
  8. mean(List a)
  9. mean(List values)