math.log1p

Full name
math.log1p
Library
math
Syntax

math.log1p(x)

Description

The math.log1p function returns the natural logarithm of 1 + x. For small x values, this function returns a more accurate result than math.log(1 + x).

Result

The math.log1p function returns a real number.

Examples

We can obtain the natural logarithm of 8 + 1 with the following code:

math.log1p(8)

2.1972245773362196

Submitted by admin on Sat, 01/30/2021 - 10:56