title: java.lang.ArithmeticException: Division is undefined
body: <p>I have a simple operation going on in my program: </p>
  
  <pre><code>exposureNoDecimals =
      BigDecimal.valueOf(curEffSpreadPremium).multiply(BigDecimal.valueOf(100)).divide(wsRate, 0,
          java.math.RoundingMode.HALF_UP).longValue();
  </code></pre>
  
  <p>exposureNoDecimals - long
  curEffSpreadPremium - long
  wsRate - BigDecimal</p>
  
  <p>However I am getting </p>
  
  <pre><code>"java.lang.ArithmeticException: Division is undefined" 
    at java.math.BigDecimal.longScaledDivide(BigDecimal.java:3105)
    at java.math.BigDecimal.divide(BigDecimal.java:2409)
    at java.math.BigDecimal.divide(BigDecimal.java:2396)
    at java.math.BigDecimal.divide(BigDecimal.java:2361)
  </code></pre>
  
  <p>The problem is the issue is recreatable on production and not on my machine (cant debug, or cant see the inputs)</p>
  
  <p>What can be the issue here? Any suggestions/ideas?</p>