Hi,
Le me explain......
Consider this..
2 instances of class Double, d1 and d2.
The value of d1.equals(d2) is true if and only if
--->> d1.doubleValue() == d2.doubleValue() <<--
The result is true if and only if the argument is not null and is a Double object that represents a double that has the identical bit
pattern to the bit pattern of the double represented by the object.
However, there are two exceptions:
--NOTE:*
If d1 and d2 both represent Double.NaN, then the equals method returns true, even though Double.NaN==Double.NaN has the value false.<<----
*If d1 represents +0.0 while d2 represents -0.0, or vice versa, the equal
test has the value false, even though +0.0==-0.0 has the value true.
And the above two exceptions clearly indicate as to y u r d1.equals(d2) returns TRUE.
Regards,
[ December 16, 2002: Message edited by: girish rateshwar ]
[ December 16, 2002: Message edited by: girish rateshwar ]