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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable