-
Bug
-
Resolution: Fixed
-
P1
-
6u14
FULL PRODUCT VERSION :
java version "1.6.0_14-ea"
Java(TM) SE Runtime Environment (build 1.6.0_14-ea-b01)
OpenJDK Client VM (build 14.0-b10, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
BigDecimal.remainder throws Exception
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See test case
ACTUAL -
AssertionError
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.AssertionError: this MutableBigInteger can't be fit into long
at java.math.MutableBigInteger.toLong(MutableBigInteger.java:129)
at java.math.MutableBigInteger.divide(MutableBigInteger.java:930)
at java.math.BigDecimal.divideAndRound(BigDecimal.java:1416)
at java.math.BigDecimal.setScale(BigDecimal.java:2377)
at java.math.BigDecimal.setScale(BigDecimal.java:2310)
at java.math.BigDecimal.divideToIntegralValue(BigDecimal.java:1710)
at java.math.BigDecimal.divideAndRemainder(BigDecimal.java:1865)
at java.math.BigDecimal.remainder(BigDecimal.java:1807)
at it.prodata.gest.test.Test.main(Test.java:79)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String s[]) {
BigDecimal bd1 = new BigDecimal("200000000000000000000000000000");
BigDecimal bd2 = BigDecimal.valueOf(97);
System.out.println(bd1.remainder(bd2));
}
}
---------- END SOURCE ----------
Release Regression From : 6u12
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
java version "1.6.0_14-ea"
Java(TM) SE Runtime Environment (build 1.6.0_14-ea-b01)
OpenJDK Client VM (build 14.0-b10, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
BigDecimal.remainder throws Exception
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See test case
ACTUAL -
AssertionError
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.AssertionError: this MutableBigInteger can't be fit into long
at java.math.MutableBigInteger.toLong(MutableBigInteger.java:129)
at java.math.MutableBigInteger.divide(MutableBigInteger.java:930)
at java.math.BigDecimal.divideAndRound(BigDecimal.java:1416)
at java.math.BigDecimal.setScale(BigDecimal.java:2377)
at java.math.BigDecimal.setScale(BigDecimal.java:2310)
at java.math.BigDecimal.divideToIntegralValue(BigDecimal.java:1710)
at java.math.BigDecimal.divideAndRemainder(BigDecimal.java:1865)
at java.math.BigDecimal.remainder(BigDecimal.java:1807)
at it.prodata.gest.test.Test.main(Test.java:79)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String s[]) {
BigDecimal bd1 = new BigDecimal("200000000000000000000000000000");
BigDecimal bd2 = BigDecimal.valueOf(97);
System.out.println(bd1.remainder(bd2));
}
}
---------- END SOURCE ----------
Release Regression From : 6u12
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
- relates to
-
JDK-6801512 Further performance enhancement for BigDecimal.toString()
- Resolved
-
JDK-6876282 BigDecimal's divide(BigDecimal bd, RoundingFormat r) produces incorrect result
- Closed