Frames | No Frames |
serialVersionUID: 8245355804974198832L
byte ind
The indicator. This may take the values:
- ispos -- the number is positive
- iszero -- the number is zero
- isneg -- the number is negative
byte form
The formatting style. This may take the values:This property is an optimization; it allows us to defer number layout until it is actually needed as a string, hence avoiding unnecessary formatting.
- MathContext.PLAIN -- no exponent needed
- MathContext.SCIENTIFIC -- scientific notation required
- MathContext.ENGINEERING -- engineering notation required
byte[] mant
The value of the mantissa. Once constructed, this may become shared between several BigDecimal objects, so must not be altered. For efficiency (speed), this is a byte array, with each byte taking a value of 0 -> 9. If the first byte is 0 then the value of the number is zero (and mant.length=1, except when constructed from a plain number, for example, 0.000).
int exp
The exponent. For fixed point arithmetic, scale is-exp
, and can apply to zero. Note that this property can have a value less than MinExp when the mantissa has more than one digit.
serialVersionUID: 7163376998892515376L
int digits
The number of digits (precision) to be used for an operation. A value of 0 indicates that unlimited precision (as many digits as are required) will be used. TheBigDecimal
operator methods use this value to determine the precision of results. Note that leading zeros (in the integer part of a number) are never significant.digits
will always be non-negative.
int form
The form of results from an operation. TheBigDecimal
operator methods use this value to determine the form of results, in particular whether and how exponential notation should be used.
boolean lostDigits
Controls whether lost digits checking is enabled for an operation. Set totrue
to enable checking, or tofalse
to disable checking. When enabled, theBigDecimal
operator methods check the precision of their operand or operands, and throw anArithmeticException
if an operand is more precise than the digits setting (that is, digits would be lost). When disabled, operands are rounded to the specified digits.
int roundingMode
The rounding algorithm to be used for an operation. TheBigDecimal
operator methods use this value to determine the algorithm to be used when non-zero digits have to be discarded in order to reduce the precision of a result. The value must be one of the public constants whose name starts withROUND_
.