MathContext

data class MathContext(precision: Int, roundingMode: RoundingMode)

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

MathContext
Link copied to clipboard
common
fun MathContext()
MathContext
Link copied to clipboard
common
fun MathContext(precision: Int)
MathContext
Link copied to clipboard
common
fun MathContext(roundingMode: RoundingMode)
MathContext
Link copied to clipboard
common
fun MathContext(precision: Int, roundingMode: RoundingMode)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

toString
Link copied to clipboard
common
open override fun toString(): String

Properties

precision
Link copied to clipboard
common
val precision: Int
roundingMode
Link copied to clipboard
common
val roundingMode: RoundingMode