img
The methods defined by Float are shown in Table 16-1. The methods defined by Double
are shown in Table 16-2. Both Float and Double define the following constants:
MAX_EXPONENT
Maximum exponent (Added by Java SE 6.)
MAX_VALUE
Maximum positive value
MIN_EXPONENT
Minimum exponent (Added by Java SE 6.)
MIN_NORMAL
Minimum positive normal value (Added by Java SE 6.)
MIN_VALUE
Minimum positive value
NaN
Not a number
POSITIVE_INFINITY
Positive infinity
NEGATIVE_INFINITY
Negative infinity
SIZE
The bit width of the wrapped value
TYPE
The Class object for float or double
Method
Description
byte byteValue( )
Returns the value of the invoking object as a byte.
static int compare(float num1,
Compares the values of num1 and num2. Returns 0 if
float num2)
the values are equal. Returns a negative value if num1
is less than num2. Returns a positive value if num1 is
greater than num2.
int compareTo(Float f)
Compares the numerical value of the invoking object with that
of f. Returns 0 if the values are equal. Returns a negative
value if the invoking object has a lower value. Returns a
positive value if the invoking object has a greater value.
double doubleValue( )
Returns the value of the invoking object as a double.
boolean equals(Object FloatObj)
Returns true if the invoking Float object is equivalent to
FloatObj. Other wise, it returns false.
static int floatToIntBits(float num)
Returns the IEEE-compatible, single-precision bit pattern
that corresponds to num.
static int floatToRawIntBits(float num) Returns the IEEE-compatible single-precision bit pattern
that corresponds to num. A NaN value is preser ved.
float floatValue( )
Returns the value of the invoking object as a float.
int hashCode( )
Returns the hash code for the invoking object.
static float intBitsToFloat(int num)
Returns float equivalent of the IEEE-compatible,
single-precision bit pattern specified by num.
int intValue( )
Returns the value of the invoking object as an int.
boolean isInfinite( )
Returns true if the invoking object contains an infinite value.
Other wise, it returns false.
static boolean isInfinite(float num)
Returns true if num specifies an infinite value. Other wise,
it returns false.
TABLE 16-1
The Methods Defined by Float
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home