Java StrictMath.getExponent(double d)

Syntax

StrictMath.getExponent(double d) has the following syntax.

public static int getExponent(double d)

Example

In the following code shows how to use StrictMath.getExponent(double d) method.


/* w  w w  . j  a  v a2 s  . c  om*/

public class Main {

  public static void main(String[] args) {
  
    double d1 = 16.2 , d2 = 512.3;

    // returns the unbiased exponent used in the representation of a double
    double exponentValue = StrictMath.getExponent(d1); 
    System.out.println("Exponent value of " + d1 + " = " + exponentValue);
        
    exponentValue = StrictMath.getExponent(d2); 
    System.out.println("Exponent value of " + d2 + " = " + exponentValue);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable