Java Array Average average(int[] pixels)

Here you can find the source of average(int[] pixels)

Description

average

License

Apache License

Declaration

public static int average(int[] pixels) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static int average(int[] pixels) {
        float m = 0;
        for (int i = 0; i < pixels.length; ++i) {
            m += pixels[i];/*from   www .  j a v a 2  s. c  o  m*/
        }
        m = m / pixels.length;
        return (int) m;
    }
}

Related

  1. average(int... is)
  2. average(int... values)
  3. average(int[] a)
  4. average(int[] array)
  5. average(int[] pixels)
  6. average(int[] x)
  7. average(long[] array)
  8. average(long[] vals)
  9. average(Number[] numbers)