title: Maximum precision below unlimited?
body: <p>I am using BigDecimal to make some calculations. Recently I ran into:</p>
  
  <pre><code>java.lang.ArithmeticException: 
  Non-terminating decimal expansion; no exact representable decimal result.
  </code></pre>
  
  <p>The answer to that problem was posted here: <a href="https://stackoverflow.com/questions/4591206/arithmeticexception-non-terminating-decimal-expansion-no-exact-representable">ArithmeticException: &quot;Non-terminating decimal expansion; no exact representable decimal result&quot;</a></p>
  
  <p>This means, there is some division with unlimited decimals, so BigDecimal tells me it cannot calculate the result exactly. To avoid this I have to call <code>BigDecimal.setScale(SOMETHING, ROUNDING_MODE);</code></p>
  
  <p>EDIT:</p>
  
  <p>The problem now is to set the SOMETHING to the maximum possible value. I could use a MathContext with precision below UNLIMITED (<code>MathContext(precision)</code>) but the same problem occurrs there. There would need to be a value below 
   <code>MathContext.UNLIMITED</code>...</p>
  
  <p>Does anyone know how to accomplish that?</p>
  
  <p>Moved my second question to:
  <a href="https://stackoverflow.com/questions/18107832/why-is-there-no-bigdecimal-setprecision-method">Why is there no BigDecimal.setPrecision() method?</a></p>
  
  <p>Thank you!</p>
  
  <p>Oliver</p>