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
Normally, we handle overflows with Math.*Exact operations, but we don't have one in this case, because:
In cases where the size is int or long and overflow errors need to be detected, the methods addExact, subtractExact, multiplyExact, and toIntExact throw an ArithmeticException when the results overflow. For other arithmetic operations such as divide, absolute value, increment, decrement, and negation overflow occurs only with a specific minimum or maximum value and should be checked against the minimum or maximum as appropriate.
Normally, we handle overflows with
Math.*Exact
operations, but we don't have one in this case, because:See https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html
Possible solution proposed by @fniephaus: smarr/SOMns#292
The text was updated successfully, but these errors were encountered: