java.lang.Math exp(double a)

Description :

This java tutorial shows an example on how to use the exp(double) method of Math class under java.lang package. This method returns the euler’s number raised to the power of double value specified as method argument.

Method Syntax :

public static double exp(double a)

Parameter Input :

DataType Parameter Description
double a the exponent to raise to

Method Returns :

The exp(double a) method simply returns the value e a, where e is the base of the natural logarithms in consideration the following cases:

  • If the argument is NaN, the result is NaN.
  • If the argument is positive infinity, then the result is positive infinity.
  • If the argument is negative infinity, then the result is positive zero.

Compatibility Version :

Requires Java 1.0.2 and up

Exception :


Java Code Example :

This java example source code demonstrates the use of exp(double a) method of Math class. Basically we just raised the e value into an exponent and print the output.

Sample Output :

Running the exp(double a) method example source code of Math class will give you the following output

Exception Scenario :


Similar Method :

  • N/A

Suggested Reading List :

References :