public final class MathUtils extends Object
Modifier | Constructor and Description |
---|---|
protected |
MathUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
max(List<Number> numbers)
Returns the max number in the numbers list.
|
static double |
mean(List<Number> numbers)
Returns the mean number in the numbers list.
|
static double |
min(List<Number> numbers)
Returns the min number in the numbers list.
|
static Range<Double> |
range(List<Number> numbers)
Returns the range of numbers.
|
static Range<Integer> |
rangeInteger(List<Number> numbers)
Returns the range of numbers.
|
static Range<Long> |
rangeLong(List<Number> numbers)
Returns the range of numbers.
|
static double |
stddev(List<Number> numbers,
boolean biasCorrected)
Returns the standard deviation of the numbers.
|
static double |
sum(List<Number> numbers)
Returns the sum number in the numbers list.
|
static double |
var(List<Number> numbers,
boolean biasCorrected)
Computes the variance of the available values.
|
public static double sum(List<Number> numbers)
numbers
- the numbers to calculate the sum.public static double mean(List<Number> numbers)
numbers
- the numbers to calculate the mean.public static double min(List<Number> numbers)
numbers
- the numbers to calculate the min.public static double max(List<Number> numbers)
numbers
- the numbers to calculate the max.public static double stddev(List<Number> numbers, boolean biasCorrected)
numbers
- the numbers to calculate the standard deviation.biasCorrected
- true if variance is calculated by dividing by n - 1. False if by n. stddev is a sqrt of the
variance.public static double var(List<Number> numbers, boolean biasCorrected)
biasCorrected
property determines whether the "population" or "sample" value is returned by the
evaluate
and getResult
methods. To compute population variances, set this property to
false
.numbers
- the numbers to calculate the variance.biasCorrected
- true if variance is calculated by dividing by n - 1. False if by n.public static Range<Double> range(List<Number> numbers)
numbers
- the numbers to calculate the range.public static Range<Integer> rangeInteger(List<Number> numbers)
numbers
- the numbers to calculate the range.