public final class BigDecimalMathUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.math.BigDecimal |
TWO |
| Modifier | Constructor and Description |
|---|---|
protected |
BigDecimalMathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
static java.math.BigDecimal |
max(java.util.List<java.math.BigDecimal> numbers)
Returns the max number in the numbers list.
|
static java.math.BigDecimal |
mean(java.util.List<java.math.BigDecimal> numbers,
java.math.MathContext context)
Returns the mean number in the numbers list.
|
static java.math.BigDecimal |
min(java.util.List<java.math.BigDecimal> numbers)
Returns the min number in the numbers list.
|
static Range<java.math.BigDecimal> |
range(java.util.List<java.math.BigDecimal> numbers)
Returns the max number in the numbers list.
|
static java.math.BigDecimal |
sqrt(java.math.BigDecimal number)
Calcualtes the square root of the number.
|
static java.math.BigDecimal |
stddev(java.util.List<java.math.BigDecimal> numbers,
boolean biasCorrected,
java.math.MathContext context)
Returns the standard deviation of the numbers.
|
static java.math.BigDecimal |
sum(java.util.List<java.math.BigDecimal> numbers)
Returns the sum number in the numbers list.
|
static java.math.BigDecimal |
var(java.util.List<java.math.BigDecimal> numbers,
boolean biasCorrected,
java.math.MathContext context)
Computes the variance of the available values.
|
public static java.math.BigDecimal sum(java.util.List<java.math.BigDecimal> numbers)
numbers - the numbers to calculate the sum.public static java.math.BigDecimal mean(java.util.List<java.math.BigDecimal> numbers,
java.math.MathContext context)
numbers - the numbers to calculate the mean.context - the MathContext.public static java.math.BigDecimal min(java.util.List<java.math.BigDecimal> numbers)
numbers - the numbers to calculate the min.public static java.math.BigDecimal max(java.util.List<java.math.BigDecimal> numbers)
numbers - the numbers to calculate the max.public static Range<java.math.BigDecimal> range(java.util.List<java.math.BigDecimal> numbers)
numbers - the numbers to calculate the max.public static java.math.BigDecimal stddev(java.util.List<java.math.BigDecimal> numbers,
boolean biasCorrected,
java.math.MathContext context)
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.context - the MathContextpublic static java.math.BigDecimal var(java.util.List<java.math.BigDecimal> numbers,
boolean biasCorrected,
java.math.MathContext context)
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.context - the MathContextpublic static java.math.BigDecimal sqrt(java.math.BigDecimal number)
number - the input number.public static void main(java.lang.String[] args)