Are there any functions (as part of a math library) which will calculate mean, median, mode and range from a set of numbers.
Check out commons math from apache. There is quite a lot there.