BigDecimal operations precision overflow <pre><code>import java.math.BigDecimal; public class TestNumber { public static void main(String[] args) { BigDecimal bd = new BigDecimal(0); bd = bd.add(new BigDecimal(19.89)); System.out.println(bd.doubleValue() + " - \t " + bd); } } </code></pre> <p>I have multiple BidDecimals fields and arithmetic operations/comparations, the problem is with arithmetic results and decimals values.</p> <p>For the above example the output is as follows:</p> <pre><code>19.89 - 19.8900000000000005684341886080801486968994140625 </code></pre> <p>I expects:</p> <p><strong><code>19.89</code></strong></p> <p>The unexpected result creates other undesirable outputs to perform operations on the field type BigDecimal</p>