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.

*Output data type: Float*

  1. import "math"
  2. math.log1p(x: 0.56)
  3. // Returns 0.44468582126144574

Parameters

x

The value used in the operation.

*Data type: Float*

Special cases

  1. math.log1p(x: +Inf) // Returns +Inf
  2. math.log1p(x: ±0) // Returns ±0
  3. math.log1p(x: -1) // Returns -Inf
  4. math.log1p(x: <-1) // Returns NaN
  5. math.log1p(x: NaN) // Returns NaN