Compute the natural logarithm of 1 plus x for various values of x.
System. |
The log1p() method in Java returns the natural logarithm of 1 + x for any given value of x.
This logarithm uses the base e, where e is approximately 2.718282, and is represented by the constant Math.E in Java.
public static double log1p(double number)
|
Parameter |
Dsecription |
number |
The input parameter must be greater than or equal to -1. If it’s less than -1, the method will return NaN (Not a Number). |
Returns: |
It returns a double value representing the natural logarithm of 1 + x, where x is a number. |
Java Version: |
1.5+ |