public final class Float4D extends java.lang.Number implements java.lang.Comparable<Float4D>
float.Number,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static float |
MAX_VALUE
Constant for the maximum
float value, (2 - 2-23) * 2127. |
static float |
MIN_VALUE
Constant for the minimum
float value, 2-149. |
static float |
NaN
Constant for the Not-a-Number (NaN) value of the
float type. |
static float |
NEGATIVE_INFINITY
Constant for the Negative Infinity value of the
float type. |
static float |
POSITIVE_INFINITY
Constant for the Positive Infinity value of the
float type. |
static int |
SIZE
Constant for the number of bits needed to represent a
float in
two's complement form. |
static java.lang.Class<java.lang.Float> |
TYPE
The
Class object that represents the primitive type float. |
| Constructor and Description |
|---|
Float4D(double value)
Constructs a new
Float with the specified primitive double value. |
Float4D(float value)
Constructs a new
Float with the specified primitive float value. |
Float4D(java.lang.String string)
Constructs a new
Float from the specified string. |
| Modifier and Type | Method and Description |
|---|---|
byte |
byteValue() |
static int |
compare(float float1,
float float2)
Compares the two specified float values.
|
int |
compareTo(Float4D object)
Compares this object to the specified float object to determine their
relative order.
|
double |
doubleValue() |
boolean |
equals(java.lang.Object object)
Compares this instance with the specified object and indicates if they
are equal.
|
static int |
floatToIntBits(float value)
Converts the specified float value to a binary representation conforming
to the IEEE 754 floating-point single precision bit layout.
|
static int |
floatToRawIntBits(float value)
Converts the specified float value to a binary representation conforming
to the IEEE 754 floating-point single precision bit layout.
|
float |
floatValue()
Gets the primitive value of this float.
|
int |
hashCode() |
static float |
intBitsToFloat(int bits)
Converts the specified IEEE 754 floating-point single precision bit
pattern to a Java float value.
|
int |
intValue() |
boolean |
isInfinite()
Indicates whether this object represents an infinite value.
|
static boolean |
isInfinite(float f)
Indicates whether the specified float represents an infinite value.
|
boolean |
isNaN()
Indicates whether this object is a Not-a-Number (NaN) value.
|
static boolean |
isNaN(float f)
Indicates whether the specified float is a Not-a-Number (NaN)
value.
|
long |
longValue() |
static float |
parseFloat(java.lang.String string)
Parses the specified string as a float value.
|
short |
shortValue() |
static java.lang.String |
toHexString(float f)
Converts the specified float into its hexadecimal string representation.
|
java.lang.String |
toString() |
static java.lang.String |
toString(float f)
Returns a string containing a concise, human-readable description of the
specified float value.
|
static java.lang.Float |
valueOf(float f)
Returns a
Float instance for the specified float value. |
static java.lang.Float |
valueOf(java.lang.String string)
Parses the specified string as a float value.
|
public static final float MAX_VALUE
float value, (2 - 2-23) * 2127.public static final float MIN_VALUE
float value, 2-149.public static final float NaN
float type.public static final float POSITIVE_INFINITY
float type.public static final float NEGATIVE_INFINITY
float type.public static final java.lang.Class<java.lang.Float> TYPE
Class object that represents the primitive type float.public static final int SIZE
float in
two's complement form.public Float4D(float value)
Float with the specified primitive float value.value - the primitive float value to store in the new instance.public Float4D(double value)
Float with the specified primitive double value.value - the primitive double value to store in the new instance.public Float4D(java.lang.String string)
throws java.lang.NumberFormatException
Float from the specified string.string - the string representation of a float value.java.lang.NumberFormatException - if string can not be decoded into a float value.parseFloat(String)public int compareTo(Float4D object)
Float.NaN is equal to Float.NaN and it is greater
than any other float value, including Float.POSITIVE_INFINITY;compareTo in interface java.lang.Comparable<Float4D>object - the float object to compare this object to.object; 0 if the value of this float and the
value of object are equal; a positive value if the value
of this float is greater than the value of object.Comparablepublic byte byteValue()
byteValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic boolean equals(java.lang.Object object)
object must be an instance of
Float and have the same float value as this object.equals in class java.lang.Objectobject - the object to compare this float with.true if the specified object is equal to this
Float; false otherwise.public static int floatToIntBits(float value)
0x7ff8000000000000L).value - the float value to convert.value.floatToRawIntBits(float),
intBitsToFloat(int)public static int floatToRawIntBits(float value)
value - the float value to convert.value.floatToIntBits(float),
intBitsToFloat(int)public float floatValue()
floatValue in class java.lang.Numberpublic int hashCode()
hashCode in class java.lang.Objectpublic static float intBitsToFloat(int bits)
bits - the IEEE 754 floating-point single precision representation of
a float value.bits.floatToIntBits(float),
floatToRawIntBits(float)public int intValue()
intValue in class java.lang.Numberpublic boolean isInfinite()
true if the value of this float is positive or negative
infinity; false otherwise.public static boolean isInfinite(float f)
f - the float to check.true if the value of f is positive or negative
infinity; false otherwise.public boolean isNaN()
true if this float is Not-a-Number;
false if it is a (potentially infinite) float number.public static boolean isNaN(float f)
f - the float value to check.true if f is Not-a-Number;
false if it is a (potentially infinite) float number.public long longValue()
longValue in class java.lang.Numberpublic static float parseFloat(java.lang.String string)
throws java.lang.NumberFormatException
string - the string representation of a float value.string.java.lang.NumberFormatException - if string is null, has a length of zero or
can not be parsed as a float value.valueOf(String)public short shortValue()
shortValue in class java.lang.Numberpublic java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String toString(float f)
f - the float to convert to a string.f.public static java.lang.Float valueOf(java.lang.String string)
throws java.lang.NumberFormatException
string - the string representation of a float value.Float instance containing the float value represented
by string.java.lang.NumberFormatException - if string is null, has a length of zero or
can not be parsed as a float value.parseFloat(String)public static int compare(float float1,
float float2)
Float.NaN is equal to Float.NaN and it is greater
than any other float value, including Float.POSITIVE_INFINITY;float1 - the first value to compare.float2 - the second value to compare.float1 is less than float2;
0 if float1 and float2 are equal; a positive
value if float1 is greater than float2.public static java.lang.Float valueOf(float f)
Float instance for the specified float value.f - the float value to store in the instance.Float instance containing f.public static java.lang.String toHexString(float f)
f - the float to convert.f.