title: Dividing BigDecimals results in ArithmeticException
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2749375/arithmeticexception-thrown-during-bigdecimal-divide">ArithmeticException thrown during BigDecimal.divide</a>  </p>
  </blockquote>
  
  
  
  <p>This results in ArithmeticException: <a href="http://ideone.com/RXeZw" rel="nofollow noreferrer">http://ideone.com/RXeZw</a></p>
  
  <p>Providing a scale and rounding mode will give me the wrong result. This example should output 50.03%. How to round this correctly?</p>
  
  <p>For easier reference, this is the code:</p>
  
  <pre><code>BigDecimal priceDiff = BigDecimal.ONE
       .subtract(new BigDecimal(9.99)
       .divide(new BigDecimal(19.99)))
       .multiply(new BigDecimal(100));
  System.out.println(priceDiff.toPlainString());
  </code></pre>