Float.equals
Class Overview | Class Members |
This Package |
All Packages
public boolean equals( Object obj )
Returns
true if the objects are the same;
false otherwise.
Description
Compares this object against some other object.
The result is true if and only if the argument is
not null and is a Float object that
represents a float that has the identical bit pattern
to the bit pattern of the float represented by this
object.
Note that in most cases, for two instances of class
Float, f1 and f2, the value
of f1.equals(f2) is true if and only if
f1.floatValue() == f2.floatValue()
also has the value true. However, there are two exceptions:
- If f1 and f2 both represent
Float.NaN, then the equals method returns
true, even though Float.NaN==Float.NaN
has the value false.
- If f1 represents +0.0f while
f2 represents -0.0f, or vice versa,
the equal test has the value false,
even though 0.0f==-0.0f has the value true.
Overrides
equals in class Object
See Also
floatToIntBits