Math.expm1()

Java Math.expm1() method

Last Updated : 17 Mar 2025

The java.lang.Math.expm1() is used to return the Euler's number e raised to the power of a double value and subtract one form it. Here, e is an Euler's number and it is approximately equal to 2.718281828459045.

Syntax

Parameter

x = It is the exponent to raise e to in the computation of ex -1.

Return

It returns the value of ex - 1

  • If the argument is positive or negative double value, this method will return the output.
  • If the argument is Positive Infinity, this method will return Positive Infinity.
  • If the argument is Negative Infinity, this method will return -1.0.
  • If the argument is Zero, this method will return Zero with the same sign as the argument.
  • If the argument is NaN, this method will return NaN.

Example 1

Output:

Example 2

Output:

Example 3

Output:

Example 4

Output:

Example 5

Output:

Example 6

Output: