-
Enhancement
-
Resolution: Fixed
-
P4
-
5.0, 6
-
b65
-
x86
-
windows_xp
-
Verified
A DESCRIPTION OF THE REQUEST :
It is sufficiently tricky to do modulo arithmetic on negative integers that methods should be provided in the Math class to do this correctly.
JUSTIFICATION :
A common mistake is to do Math.abs(n) % MODULO. If there were methods in the library that would do it right, these bugs could be more easily avoided. I note that BigInteger has a mod() method (presumably for efficiency).
###@###.### 2005-06-08 06:41:24 GMT
It is sufficiently tricky to do modulo arithmetic on negative integers that methods should be provided in the Math class to do this correctly.
JUSTIFICATION :
A common mistake is to do Math.abs(n) % MODULO. If there were methods in the library that would do it right, these bugs could be more easily avoided. I note that BigInteger has a mod() method (presumably for efficiency).
###@###.### 2005-06-08 06:41:24 GMT
- duplicates
-
JDK-6463999 We need native floor-based division for integers.
-
- Closed
-
- relates to
-
JDK-4639626 The % is currently unable to deal with negative numbers properly
-
- Closed
-
-
JDK-8004066 TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message
-
- Closed
-
-
JDK-8014296 java/lang/Math/DivModTests.java should not compare pointers
-
- Closed
-