This is effectively just scientific notation. As it says in the docs, the value of a BigDecimal
is:
unscaledValue × 10^(-scale)
Thus multiplying two BigDecimal
s is equivalent to multiplying their unscaledValue
s and adding their scale
s:
a * b
== (uA * 10^-sA) * (uB * 10^-sB)
== (uA * uB) * 10^-(sA + sB)