Home >>Python math Module >Python math.log1p() Method

Python math.log1p() Method

Python math.log1p() Method

Python math.log1p() method is used to returns log(1+number) value computed in a way that is accurate even when the value of the number is close to the zero.

Syntax:
math.log1p(x)

Parameter Values

Parameter Description
x This is a required parameter. It defines the number to process.
Here is an example of Python math.log1p() method:

import math
print(math.log1p(10))
print(math.log1p(2))
print(math.log1p(1))

Output:
2.3978952727983707
1.0986122886681096
0.6931471805599453

No Sidebar ads