J2SE Version (please include all output from java -version flag):
C:\java\j2sdk1.5.0_beta2\bin>java -version
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
Does this problem occur on J2SE 1.4 or 1.4.1 or 1.4.2? Yes / No (pick one)
NO
Operating System Configuration Information (be specific):
OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 1 Build 2600
Bug Description:
Behavior of BigDecimal.toString has changed. In J2SE 1.4.x and prior, the
BigDecimal.toString method returned the string representation of the value
1E-15 as 0.000000000000001. In J2SE 1.5 the toString method returns the
value 1E-15 as 1.0E-15.
While I understand this was done intentionally, this does cause a problem
in our product which makes J2SE 1.5 not backward compatible with our product.
It is easy enough to fix in our product, but I felt we should at least point
out the issue.
Steps to Reproduce (be specific):
BigDecimal bd = new BigDecimal("1E-15");
String val = bd.toString();
bd = new BigDecimal(".000000000000001");
val = bd.toString();
The value returned by both two string methods will be different when run against 1.4 vs 1.5
###@###.### 2005-07-19 18:03:55 GMT
C:\java\j2sdk1.5.0_beta2\bin>java -version
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
Does this problem occur on J2SE 1.4 or 1.4.1 or 1.4.2? Yes / No (pick one)
NO
Operating System Configuration Information (be specific):
OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 1 Build 2600
Bug Description:
Behavior of BigDecimal.toString has changed. In J2SE 1.4.x and prior, the
BigDecimal.toString method returned the string representation of the value
1E-15 as 0.000000000000001. In J2SE 1.5 the toString method returns the
value 1E-15 as 1.0E-15.
While I understand this was done intentionally, this does cause a problem
in our product which makes J2SE 1.5 not backward compatible with our product.
It is easy enough to fix in our product, but I felt we should at least point
out the issue.
Steps to Reproduce (be specific):
BigDecimal bd = new BigDecimal("1E-15");
String val = bd.toString();
bd = new BigDecimal(".000000000000001");
val = bd.toString();
The value returned by both two string methods will be different when run against 1.4 vs 1.5
###@###.### 2005-07-19 18:03:55 GMT
- relates to
-
JDK-4984872 (jsr 13) BigDecimal needs toString method without exponents
- Resolved
-
JDK-6364896 Document compatibility issue of J2SE 5.0's BigDecimal.toString()
- Closed