Math Context
data class MathContext(val precision: Int = 9, val roundingMode: RoundingMode = RoundingMode.HALF_UP)
Immutable objects which encapsulate the context settings which describe certain rules for numerical operators, such as those implemented by the BigDecimal class.
The base-independent settings are:
precision: the number of digits to be used for an operation; results are rounded to this precisionroundingMode: a RoundingMode object which specifies the algorithm to be used for rounding.
Author
Mike Cowlishaw
Joseph D. Darcy
Since
1.5