Java Math.log1p(double x)

Syntax

Math.log1p(double x) has the following syntax.

public static double log1p(double x)

Example

In the following code shows how to use Math.log1p(double x) method.


/*www. j  av a 2s .co  m*/

public class Main {

   public static void main(String[] args) {
      double x = 123456.7;
      double y = -123.45;


      // call log1p and print the result
      System.out.println("Math.log1p(" + x + ")=" + Math.log1p(x));

      // call log1p and print the result
      System.out.println("Math.log1p(" + y + ")=" + Math.log1p(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