java.lang.Objectjava.math.MathContext
All Implemented Interfaces:
Serializable
The base-independent settings are:
Mike - CowlishawJoseph - D. Darcy1.5 - | Field Summary | ||
|---|---|---|
| public static final MathContext | UNLIMITED | A {@code MathContext} object whose settings have the values
required for unlimited precision arithmetic.
The values of the settings are:
precision=0 roundingMode=HALF_UP
|
| public static final MathContext | DECIMAL32 | A {@code MathContext} object with a precision setting matching the IEEE 754R Decimal32 format, 7 digits, and a rounding mode of HALF_EVEN , the IEEE 754R default. |
| public static final MathContext | DECIMAL64 | A {@code MathContext} object with a precision setting matching the IEEE 754R Decimal64 format, 16 digits, and a rounding mode of HALF_EVEN , the IEEE 754R default. |
| public static final MathContext | DECIMAL128 | A {@code MathContext} object with a precision setting matching the IEEE 754R Decimal128 format, 34 digits, and a rounding mode of HALF_EVEN , the IEEE 754R default. |
| final int | precision | The 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.
{@code precision} will always be non-negative.
|
| final RoundingMode | roundingMode | The rounding algorithm to be used for an operation.
|
| transient BigInteger | roundingMax | Lookaside for the rounding points (the numbers which determine whether the coefficient of a number will require rounding). These will be present if {@code precision > 0} and {@code precision <= MAX_LOOKASIDE}. In this case they will share the {@code BigInteger int[]} array. Note that the transients cannot be {@code final} because they are reconstructed on deserialization. |
| transient BigInteger | roundingMin | |
| Constructor: |
|---|
|
An {@code IllegalArgumentException} is thrown if the precision section of the string is out of range ({@code < 0}) or the string is not in the format created by the #toString method.
|
|
| Method from java.math.MathContext Summary: |
|---|
| equals, getPrecision, getRoundingMode, hashCode, toString |
| Methods from java.lang.Object: |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.math.MathContext Detail: |
|---|
|
|
|
|
For example: precision=9 roundingMode=HALF_UPAdditional words may be appended to the result of {@code toString} in the future if more properties are added to this class. |