Java Math.exp(double a)

Syntax

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

public static double exp(double a)

Example

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


//from  w w w  .j a  v a 2 s.c om
public class Main {

   public static void main(String[] args) {

      double x = 5;
      double y = 0.5;

      // print e raised at x and y
      System.out.println("Math.exp(" + x + ")=" + Math.exp(x));
      System.out.println("Math.exp(" + y + ")=" + Math.exp(y));


   }
}

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