# BigDecimal and BigInteger

• 11-28-2010, 09:17 AM
jon80
BigDecimal and BigInteger
"Immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale. If zero or positive, the scale is the number of digits to the right of the decimal point. If negative, the unscaled value of the number is multiplied by ten to the power of the negation of the scale. The value of the number represented by the BigDecimal is therefore (unscaledValue × 10-scale)."

Source: JAVA API for java.math.BigDecimal
Java Platform Standard Ed. 6, available at Java Platform SE 6.

Hence, what is the smallest/largest number that may be represented by BigInteger and BigDecimal, in layman's terms?

How is it possible to deduce the minimum and maximum values, and, display them programmatically?
• 11-28-2010, 09:26 AM
Eranga
This may helpful to you. I've just read this few days ago. :)
• 11-28-2010, 10:14 AM
jon80
Indeed, but it does not seem to answer my questions.
• 11-28-2010, 10:21 AM
JosAH
Quote:

Originally Posted by Eranga
This may helpful to you. I've just read this few days ago. :)

That is a crappy page; nothing in it isn't described (in much greater detail) in the API documentation for the BigInteger class. It's a waste of bandwidth and not worthy to be a Wiki page.

kind regards,

Jos
• 11-28-2010, 10:57 AM
pbrockway2
Quote:

How is it possible to deduce the minimum and maximum values, and, display them programmatically?

The 32 bit scale of a BigDecimal indicates that it can get big. As Douglas Adams would say: really, really big.
• 11-28-2010, 11:58 AM
Eranga
Quote:

Originally Posted by jon80
Indeed, but it does not seem to answer my questions.

I agreed. Conceptually for me it is, but not programmatically.
• 11-28-2010, 12:01 PM
Eranga
Quote:

Originally Posted by JosAH
It's a waste of bandwidth and not worthy to be a Wiki page.

• 11-28-2010, 12:07 PM
JosAH
Quote:

Originally Posted by Eranga