Module java.base
Package java.math

Class MathContext

java.lang.Object
java.math.MathContext
All Implemented Interfaces:
Serializable

public final class MathContext extends Object implements Serializable
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.
Since:
1.5
See Also: