All methods of java.lang.StrictMath class : Set 1, Set 2
The java.lang.StrictMath.exp() is an inbuilt method in Java is used to return a Euler number raised to the power of the specified double value. It gives rise to three special results:
- The result is positive infinity when the given argument is positive infinity.
- The result is positive zero when the argument is negative infinity.
- The result is NaN when the given argument is NaN.
public static double exp(double num)
Parameters: This method accepts one parameter num which is of double type which is the exponent to raise e to.
Return Value: The method returns the value e^num, where e is the base of the natural logarithms.
Input: num = 7 Output: 1096.6331584284585 Input: num = (1.0 / 0.0) Output: Infinity
Below programs illustrate the java.lang.StrictMath.exp() method:
The exp value of 0.0 = 1.0 The exp value of Infinity = Infinity The exp value of 4.0 = 54.598150033144236
The exp value of -0.0 = 1.0 The exp value of Infinity = Infinity The exp value of 14.0 = 1202604.2841647768
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.