<p>This code creates a BigDecimal from a double value that doesn't translate well to a decimal number. For example, 
one might assume that writing <code>new BigDecimal(0.1)</code> in Java creates a BigDecimal which is exactly equal to 0.1 
(an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625. 
You probably want to use the <code>BigDecimal.valueOf(double d)</code> method, which uses the String representation of the double to 
create the BigDecimal (e.g., <code>BigDecimal.valueOf(0.1)</code> gives 0.1).</p>