Here you can find the source of getStdDeviation(List
public static <T extends Number> double getStdDeviation(List<T> numbers)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <T extends Number> double getStdDeviation(List<T> numbers) { return getStdDeviation(numbers, getAverage(numbers)); }//from w w w .j a v a 2s . co m public static <T extends Number> double getStdDeviation(List<T> numbers, double average) { double deviation = 0; for (T i : numbers) deviation += Math.pow(i.doubleValue() - average, 2); return Math.sqrt(deviation / numbers.size()); } public static <T extends Number> double getAverage(List<T> numbers) { double avg = 0; for (T i : numbers) avg += i.doubleValue(); return avg / numbers.size(); } }