JavaScript log1p() Method
Example
Return the natural logarithm (base E) of 1 + different numbers:
var a = Math.log1p(2.7183);
var b = Math.log1p(2);
var c =
Math.log1p(1);
var d = Math.log1p(0);
var e = Math.log1p(-1);
Try it Yourself »
Definition and Usage
The log1p() method returns the natural logarithm (base E) of 1 + a specified number.
Browser Support
| Method | |||||
|---|---|---|---|---|---|
| log1p() | 38.0 | 12.0 | 25.0 | 8.0 | 25.0 |
Syntax
Math.log1p(x)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. A number |
Technical Details
| Return Value: | A Number, representing the natural logarithm (base E) of 1 + the specified
number If the number is -1, -Infinity is returned. If the number is less than -1, it returns NaN |
|---|---|
| JavaScript Version: | ECMAScript 2015 |
