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


public static double exp(double a)


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:


Example 2:


Example 3:


Example 4:


Example 5:


Pin It on Pinterest

Share This