Java Math.expm1(double x)
Syntax
Math.expm1(double x) has the following syntax.
public static double expm1(double x)
Example
In the following code shows how to use Math.expm1(double x) method.
public class Main {
/* w w w . j a va2 s . c o m*/
public static void main(String[] args) {
double x = 5;
double y = 0.5;
// call expm1 for both numbers and print the result
System.out.println("Math.expm1(" + x + ")=" + Math.expm1(x));
System.out.println("Math.expm1(" + y + ")=" + Math.expm1(y));
}
}
The code above generates the following result.