log1p()
log1p(x) returns natural logarithm of 1+x (base e )( What is e ? )
import math
print(math.log1p(2)) # 1.0986122886681098
print(math.log1p(4)) # 1.6094379124341003
print(math.log1p(0)) # 0.0
Using negative number
For any value less than or equal to 0 , we will get ValueError
import math
print(math.log1p(-2))
Above code will generate error.
« log
modf()
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com