91
Java Math.exp() method
The java.lang.Math.exp() is used to return the Euler’s number e raised to the power of a double value. Here, e is an Euler’s number and it is approximately equal to 2.718281828459045.
Syntax
Parameter
Return
It returns the value ex, where e is the base of the natural logarithms.
- If the argument is positive or negative double value, this method will return the output.
- IIf the argument is Zero, this method will return 1.0.
- IIf the argument is Positive Infinity, this method will return Positive Infinity.
- IIf the argument is Negative Infinity, this method will return Positive Zero.
- IIf the argument is NaN, this method will return NaN.
Example 1
Output:
7.38905609893065
Example 2
Output:
9.118819655545162E-4
Example 3
Output:
1.0
Example 4
Output:
Infinity
Example 5
Output:
0.0
Example 6
Output:
NaN
Next TopicJava Math