66
Java Math.expm1() method
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:
6.38905609893065
Example 2
Output:
-0.9990881180344455
Example 3
Output:
0.0
Example 4
Output:
Infinity
Example 5
Output:
-1.0
Example 6
Output:
NaN
Next TopicJava Math