Java StrictMath.exp(double a)

Syntax

StrictMath.exp(double a) has the following syntax.

public static double exp(double a)

Example

In the following code shows how to use StrictMath.exp(double a) method.


//  w w w  . jav a  2s.  c  o  m

public class Main {

  public static void main(String[] args) {
  
    double d1 = 0.0 , d2 = -0.0, d3 = (1.0/0.0), d4 = 5;

    // returns Euler's number e raised to the power positive 0 
    System.out.println("Euler value of d1 = " + StrictMath.exp(d1));
        
    // returns Euler's number e raised to the power negative 0
    System.out.println("Euler value of d2 = " + StrictMath.exp(d2));
        
    // returns Euler's number e raised to the power infinity
    System.out.println("Euler value of d3 = " + StrictMath.exp(d3));
        
    // returns Euler's number e raised to the power 5
    System.out.println("Euler value of d4 = " + StrictMath.exp(d4));
  }
}

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