JavaScript log1p() method
- Previous Page log10()
- Next Page log2()
- Go to the Previous Level JavaScript Math Reference Manual
Definition and usage
log1p()
The method returns 1 + the natural logarithm (base E) of the specified number.
Example
Returns 1 + the natural logarithm (base E) of 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);
Syntax
Math.log1p(x)
Parameter value
Parameter | Description |
---|---|
x | Required. Number. |
Technical details
Return value: |
A number representing the natural logarithm (base E) of 1 + the specified number
|
---|---|
JavaScript Version: | ECMAScript 2015 |
Browser Support
Method | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
log1p() | 38.0 | 12.0 | 25.0 | 8.0 | 25.0 |
Related Pages
Tutorial:JavaScript Math
- Previous Page log10()
- Next Page log2()
- Go to the Previous Level JavaScript Math Reference Manual