Java Math exp() Method

Facebooktwitterredditpinterestlinkedinmailby feather

The exp() method of Math class returns Euler’s number(e) raised to the power of a double value.

Syntax:

public static double exp(double a)

Parameters:

The parameter ‘a’ represents the exponent e.

Return Value:

The exp () method returns the value ea, where e represents the base of the natural logarithms.

Special cases of the exp() method are as follows:

  • It returns NaN, is the argument passed is NaN.
  • It returns positive infinity, if the argument passed is positive infinity.
  • It returns positive zero, if the argument passed is negative infinity.

Example 1:


 Output:

Example 2:

  Output:

Example 3:

 Output:

Example 4:

 Output:

Example 5:

 Output:

Facebooktwitterredditpinterestlinkedinmailby feather