Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
The equals methods on Float and Double are *not* just wrappers around the corresponding == operator because the IEEE 754 == operator does *not* define an equivalence relation. The properties of an equivalence relation are broken by NaN (since NaN is not equal to itself) and by -0.0/+0.0. While -0.0 and +0.0 compare as equal, they are distinct values that can change the value of a result of an operation; for example, +1.0/+0.0 is positive infinity while +1.0/-0.0 is negative infinity. This situation could be more clearly motivated than the oblique "This definition allows hash tables to operate properly." statement equals methods.
|