MathContext

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:

  1. precision: the number of digits to be used for an operation; results are rounded to this precision

  2. roundingMode: a RoundingMode object which specifies the algorithm to be used for rounding.

Author

Mike Cowlishaw

Joseph D. Darcy

Since

1.5

See also

Constructors

Link copied to clipboard
constructor(precision: Int = 9, roundingMode: RoundingMode = RoundingMode.HALF_UP)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val precision: Int = 9
Link copied to clipboard

Functions

Link copied to clipboard