ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”

From the Java 11 BigDecimal docs: When a MathContext object is supplied with a precision setting of 0 (for example, MathContext.UNLIMITED), arithmetic operations are exact, as are the arithmetic methods which take no MathContext object. (This is the only behavior that was supported in releases prior to 5.) As a corollary of computing the exact result, the rounding mode setting of a MathContext object with … Read more

ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”

From the Java 11 BigDecimal docs: When a MathContext object is supplied with a precision setting of 0 (for example, MathContext.UNLIMITED), arithmetic operations are exact, as are the arithmetic methods which take no MathContext object. (This is the only behavior that was supported in releases prior to 5.) As a corollary of computing the exact result, the rounding mode setting of a MathContext object with … Read more

ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”

From the Java 11 BigDecimal docs: When a MathContext object is supplied with a precision setting of 0 (for example, MathContext.UNLIMITED), arithmetic operations are exact, as are the arithmetic methods which take no MathContext object. (This is the only behavior that was supported in releases prior to 5.) As a corollary of computing the exact result, the rounding mode setting of a MathContext object with … Read more

ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”

From the Java 11 BigDecimal docs: When a MathContext object is supplied with a precision setting of 0 (for example, MathContext.UNLIMITED), arithmetic operations are exact, as are the arithmetic methods which take no MathContext object. (This is the only behavior that was supported in releases prior to 5.) As a corollary of computing the exact result, the rounding mode setting of a MathContext object with … Read more