Java Reference
In-Depth Information
The value for +
.
public final static float
NEGATIVE_INFINITY
The value for -
.
public final static float
NaN
Not-a-Number. This constant gives you a way to get a NaN
value, not to test one. Surprising as it may be,
NaN== NaN
is al-
ways false because a NaN value, not being a number, is equal
to no value, not even itself. To test whether a number is NaN,
you must use the
isNaN
method.
public static boolean
isNaN(float val)
Returns
true
if
val
is a Not-a-Number (NaN) value.
public static boolean
isInfinite(float val)
Returns
true
if
val
is either positive or negative infinity.
public boolean
isNaN()
Returns
true
if this object's value is a Not-a-Number (NaN)
value.
public boolean
isInfinite()
Returns
true
if this object's value is either positive or negative
infinity.
In addition to the usual constructor forms,
Float
has a constructor that
takes a
double
argument to use as its initial value after conversion to
float
.