Readonly precisionThe number of digits to be used for an operation. A value of 0 indicates that unlimited precision (as many digits as are required) will be used. Note that leading zeros (in the coefficient of a number) are never significant.
precision will always be non-negative.
Readonly roundingThe rounding algorithm to be used for an operation. By default it is HALF_UP.
see RoundingMode
Static DECIMAL128A MathContext object with a precision setting
matching the precision of the IEEE 754-2019 decimal128 format, 34 digits, and a
rounding mode of HALF_EVEN.
Note the exponent range of decimal64 is not used for
rounding.
Static DECIMAL32A MathContext object with a precision setting
matching the precision of the IEEE 754-2019 decimal32 format, 7 digits, and a
rounding mode of HALF_EVEN.
Note the exponent range of decimal32 is not used for
rounding.
Static DECIMAL64A MathContext object with a precision setting
matching the precision of the IEEE 754-2019 decimal64 format, 16 digits, and a
rounding mode of HALF_EVEN.
Note the exponent range of decimal64 is not used for
rounding.
Static UNLIMITEDA MathContext object whose settings have the values
required for unlimited precision arithmetic.
The values of the settings are: precision=0 roundingMode=HALF_UP
Generated using TypeDoc
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:
Sample Usage: