Java List Mean mean(List values)

Here you can find the source of mean(List values)

Description

mean

License

LGPL

Declaration

public static float mean(List<Float> values) 

Method Source Code

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

import java.util.List;

public class Main {
    public static float mean(List<Float> values) {
        float mean = 0;
        for (float value : values) {
            mean += value;/*from   w  ww .j a  v  a2s .co  m*/
        }
        mean = mean / (float) values.size();
        return mean;
    }

    public static float mean(float[] values) {
        float mean = 0;
        for (float value : values) {
            mean += value;
        }
        mean = mean / (float) values.length;
        return mean;
    }
}

Related

  1. mean(List list)
  2. mean(List list)
  3. mean(List vals)
  4. mean(List values)
  5. mean(List values)
  6. mean(List numbers)
  7. meanAbsolute(List vector)
  8. meanDouble(List list)
  9. meanDoubleList(List list)