Math.log()
Math.log(x) → number
Returns the natural logarithm (base e) of x.
Returns the natural logarithm (㏑) of x. Returns -Infinity for 0 and NaN for negative values.
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| x | number | optional | — | A number greater than or equal to 0. |
Returns
number
The natural logarithm of x.
Example
let l = Math.log(Math.E); // 1