Serialized Form

Package com.ibm.icu.math

Class com.ibm.icu.math.BigDecimal extends Number implements Serializable

serialVersionUID: 8245355804974198832L

Serialized Fields

ind

 byte ind
The indicator. This may take the values:
  • ispos -- the number is positive
  • iszero -- the number is zero
  • isneg -- the number is negative

form

 byte form
The formatting style. This may take the values:
  • MathContext.PLAIN -- no exponent needed
  • MathContext.SCIENTIFIC -- scientific notation required
  • MathContext.ENGINEERING -- engineering notation required

This property is an optimization; it allows us to defer number layout until it is actually needed as a string, hence avoiding unnecessary formatting.


mant

 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).


exp

 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.

Class com.ibm.icu.math.MathContext extends Object implements Serializable

serialVersionUID: 7163376998892515376L

Serialized Fields

digits

 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.

The BigDecimal 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.


form

 int form
The form of results from an operation.

The BigDecimal operator methods use this value to determine the form of results, in particular whether and how exponential notation should be used.


lostDigits

 boolean lostDigits
Controls whether lost digits checking is enabled for an operation. Set to true to enable checking, or to false to disable checking.

When enabled, the BigDecimal operator methods check the precision of their operand or operands, and throw an ArithmeticException 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.


roundingMode

 int roundingMode
The rounding algorithm to be used for an operation.

The BigDecimal 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 with ROUND_.


Copyright (c) 2006 IBM Corporation and others.