StrictMath.expm1(): This method is available in java.lang.StrictMath class of Java.
Syntax:
double java.lang.StrictMath.expm1(double x)
This method takes one argument of type double as its parameter. This method returns e^x -1 ( e pow x -1).
Special cases:
1. If the argument is NaN, the result is NaN.
2. If the argument is positive infinity, then the result is positive infinity.
3. If the argument is negative infinity, then the result is-1.0.
4. If the argument is zero, then the result is a zero with the same sign as the argument.
Parameters: One parameter is required for this method.
x: the exponent to raise e to in the computation of e^x -1.
Returns: the value e^x - 1.
Exceptions: NA
Approach
Java
public class StrictMathexpm1 {public static void main(String[] args) {double x = 19;System.out.println(StrictMath.expm1(x));}}
Output:
1.7848229996318728E8
No comments:
Post a Comment