ArithmeticException « bigdecimal « Java Data Type Q&A





1. ArithmeticException thrown during BigDecimal.divide    stackoverflow.com

I thought java.math.BigDecimal is supposed to be The Answer™ to the need of performing infinite precision arithmetic with decimal numbers. Consider the following snippet:

import java.math.BigDecimal;
//...

final BigDecimal one = BigDecimal.ONE;
final BigDecimal ...