Retrieve the exponents of various floating-point numbers.
System. |
The getExponent() method retrieves the unbiased exponent of a floating-point number as represented internally in Java.
Java internally represents each floating-point number as m·2^x. The getExponent() method provides the value of x for any floating-point number. The term “unbiased” indicates that the exponent is internally stored only as a positive number, introducing a positive bias. Subtracting this bias from the exponent yields the unbiased (true) value of the exponent.
One of the following:
public static int getExponent(double number)
|
public static int getExponent(float number)
|
Parameter |
Description |
number |
Needed: A floating-point number for which to retrieve the exponent. |
Returns |
An integer value that signifies the impartial exponent in Java’s internal depiction of a floating-point number. |
Java Version |
1.6+ |