Details
Description
"Returns the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient. There is one special case, if the dividend is the Integer.MIN_VALUE and the divisor is -1, then integer overflow occurs and the result is equal to the Integer.MIN_VALUE."
The analogous special case obtains as well for floorDiv(long,long). Instead of ignoring the numeric overflow, a method floorDivExact() would throw an ArithmeticException when the dividend is the respective MIN_VALUE and the divisor is -1.
Attachments
Issue Links
- csr for
-
JDK-8271518 Add floorDivExact() method to java.lang.[Strict]Math
-
- Closed
-
- is blocked by
-
JDK-8271599 Javadoc of floorDiv() and floorMod() families is inaccurate in some places
-
- Closed
-
- relates to
-
JDK-8075806 divideExact is missing in java.lang.Math
-
- Resolved
-