I saw someone, I think it was s.o.s, recommend the use of BigDecimal to someone else. So out of curiosity, and having heard of BigDecimal before, I looked at the Javadoc to see how large the values it could hold were and how it held them. From the doc:
"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). "
What does an unscaled value refer to? One that hasn't been correctly sized, and therefore doesn't represent anything in its present state? It seems like whats above could be referring to, lets say we had unscaled value = 123456789 and scale = 5. Then the BigDecimal would treat the scaled version as 123456789.00000? And if scale = -5 it'd be 1234.56789? Is that correct? And how does BigDecimal store numbers?