Class java.lang.Float
All Packages This Package Previous Next
Class java.lang.Float
java.lang.Object
|
+----java.lang.Number
|
+----java.lang.Float
-
public final class
Float
-
extends Number
The Float class is a wrapper for float values.
-
Version:
-
1.17, 18 May 1995
-
Author:
-
Lee Boynton,
Arthur van Hoff
-
E
-
e = 2.718...
-
MAX_VALUE
-
The maximum value a float can have.
-
MIN_VALUE
-
The minimum value a float can have.
-
NEGATIVE_INFINITY
-
Negative inifinity.
-
PI
-
pi = 3.1415...
-
POSITIVE_INFINITY
-
Positive inifinity.
-
Float(float)
-
Constructs a wrapper for the given float value.
-
doubleValue()
-
Returns the double value
-
equals(Object)
-
Compares this object against some other object.
-
floatValue()
-
Returns the float value
-
hashCode()
-
Returns a hashcode for this float.
-
intValue()
-
Returns the integer value of this float (by casting to an int).
-
isInfinite(float)
-
Returns true if the number is infinitely large in magnitude.
-
isInfinite()
-
Returns true if this float value is infinitely large in magnitude.
-
isNan(float)
-
Returns true if the argument is the special Not-a-Number (NaN) value.
-
isNan()
-
Returns true if this float value is Not-a-Number (NaN).
-
longValue()
-
Returns the long value of this float (by casting to a long).
-
toString(float)
-
Returns a string representation for the specified float value.
-
toString()
-
Returns a string representation of this Float object.
-
valueOf(String)
-
Returns a floating point value that the string represents.
POSITIVE_INFINITY
public final static float POSITIVE_INFINITY
-
Positive inifinity.
NEGATIVE_INFINITY
public final static float NEGATIVE_INFINITY
-
Negative inifinity.
MAX_VALUE
public final static float MAX_VALUE
-
The maximum value a float can have.
MIN_VALUE
public final static float MIN_VALUE
-
The minimum value a float can have.
PI
public final static float PI
-
pi = 3.1415...
E
public final static float E
-
e = 2.718...
Float
public Float(float value)
-
Constructs a wrapper for the given float value.
-
Parameters:
-
value
-
the value of the Float
toString
public static String toString(float f)
-
Returns a string representation for the specified float value.
-
Parameters:
-
f
-
the float to be converted
-
Returns:
-
a string representing the value
valueOf
public static Float valueOf(String s)
-
Returns a floating point value that the string represents.
-
Parameters:
-
s
-
the string that is to be parsed
-
Returns:
-
a float object representing the float value of the string
-
Throws: NumberFormatException
-
The string does not contain a parsable float
isNan
public static boolean isNan(float v)
-
Returns true if the argument is the special Not-a-Number (NaN) value.
-
Parameters:
-
v
-
the value to be tested
-
Returns:
-
true if the value is NaN
isInfinite
public static boolean isInfinite(float v)
-
Returns true if the number is infinitely large in magnitude.
-
Parameters:
-
v
-
the value to be tested
-
Returns:
-
true if the value is infinitely large in magnitude
isNan
public boolean isNan()
-
Returns true if this float value is Not-a-Number (NaN).
isInfinite
public boolean isInfinite()
-
Returns true if this float value is infinitely large in magnitude.
toString
public String toString()
-
Returns a string representation of this Float object.
-
Returns:
-
a string representation this float
-
Overrides:
-
toString in class Object
intValue
public int intValue()
-
Returns the integer value of this float (by casting to an int).
-
Overrides:
-
intValue in class Number
longValue
public long longValue()
-
Returns the long value of this float (by casting to a long).
-
Overrides:
-
longValue in class Number
floatValue
public float floatValue()
-
Returns the float value
-
Overrides:
-
floatValue in class Number
doubleValue
public double doubleValue()
-
Returns the double value
-
Overrides:
-
doubleValue in class Number
hashCode
public int hashCode()
-
Returns a hashcode for this float.
-
Overrides:
-
hashCode in class Object
equals
public boolean equals(Object obj)
-
Compares this object against some other object.
Note: To be useful in hashtables this method
considers two Nan floating point values to be equal. This
is not according to IEEE specification
-
Parameters:
-
obj
-
the object to compare with
-
Returns:
-
true if the object is the same
-
Overrides:
-
equals in class Object
All Packages This Package Previous Next