Change in behavior of BigDecimal.valueOf() for Java 1.4 & 1.5



12 years ago
5 years ago


(Reporter: harprit_singh, Unassigned)





12 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1)
Build Identifier: Rhino 1.6R3

The script:
returns different values for JDK 1.4 & 1.5

Due to this the comparison checks of BigDecimal data in our implementation are failing (when we made transition from Java 1.4 to Java 1.5)

Reproducible: Always

Steps to Reproduce:
script -

1. Evaluate above script using Java 1.4.2_10 
2. Evaluate above script using Java 1.5.0_10
Actual Results:  
Output of Step 1: 50
Output of Step 2: 50.0

Expected Results:  
Output of Step 1: 50
Output of Step 2: 50 

Change in JDK version should not change the output from 50 to 50.0
or please let us know the reason for this change.

Comment 1

12 years ago
The behavior of method: BigDecimal.valueOf(long) has not changed in Java i.e. call to BigDecimal.valueOf(50)returns the same output (50) for both JDK 1.4 & 1.5
You need to log in before you can comment on or make changes to this bug.