827 B
827 B
title | description | menu | weight | ||||||
---|---|---|---|---|---|---|---|---|---|
math.log1p() function | The math.log1p() function returns the natural logarithm of 1 plus its argument `x`. It is more accurate than `math.log(x: 1 + x)` when `x` is near zero. |
|
301 |
The math.log1p()
function returns the natural logarithm of 1 plus its argument x
.
It is more accurate than math.log(x: 1 + x)
when x
is near zero.
Output data type: Float
import "math"
math.log1p(x: 0.56)
// Returns 0.44468582126144574
Parameters
x
The value used in the operation.
Data type: Float
Special cases
math.log1p(x: +Inf) // Returns +Inf
math.log1p(x: ±0) // Returns ±0
math.log1p(x: -1) // Returns -Inf
math.log1p(x: <-1) // Returns NaN
math.log1p(x: NaN) // Returns NaN