The expm1() method of Math class returns ex-1 where e represents Euler’s number.


public static double expm1(double x)


The parameter ‘x’ represents the exponent to raise e in the calculation of ex-1.

Return Value:

The expm1 () method returns the value of ex – 1.

Special cases of the expm1() 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 -1.0, if the argument passed is negative infinity.
  • It returns zero with the same sign as the argument, if the argument passed is zero.

Example 1:


Example 2:


Example 3:


Example 4:


Example 5:


Pin It on Pinterest

Share This