You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Occurs when the result of a division is recurring (never ending), and we haven't specified rounding mode/scale. In other words, BigDecimal won't know how to represent a recurring division result if we haven't specified to what decimal places the result should be rounded, so it throws this exception.
Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
at java.base/java.math.BigDecimal.divide(BigDecimal.java:1722)
at ArithEx.main(ArithEx.java:7)
Description
Generic arithmetic error, like division by zero or an overflow.
Sample Code
Sample Error Message
Implementation Checklist
The text was updated successfully, but these errors were encountered: