Return the unbiased exponent value of a double in Java
Description
The following code shows how to return the unbiased exponent value of a double.
Example
/* ww w . j ava 2 s . co m*/
public class Main {
public static void main (String[] args) {
// Returns the unbiased exponent value of a double,
// where 2^exp <= d. In this case, 2^4 <= 17
int exp = Math.getExponent (17.0);
System.out.println ("Math.getExponent (17.0) = " + exp);
}
}
The code above generates the following result.