Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,945 questions

51,887 answers

573 users

How to calculate natural base e logarithm of 1 + number in Python

1 Answer

0 votes
import math

print("math.log1p(1) = ", math.log1p(1))
print("math.log1p(0) = ", math.log1p(0))
print("math.log1p(-0) = ", math.log1p(-0))
print("math.log1p(5) = ", math.log1p(5))
print("math.log1p(100) = ", math.log1p(100))
print("math.log1p(125) = ", math.log1p(125))
print("math.log1p(125) / math.log10(5) = ", math.log1p(125) / math.log1p(5))
print("math.log1p(math.pi) = ", math.log1p(math.pi))
print("math.log1p(1000) = ", math.log1p(1000))
print("math.log1p(0.001) = ", math.log1p(0.001))


'''
run:

math.log1p(1) =  0.6931471805599453
math.log1p(0) =  0.0
math.log1p(-0) =  0.0
math.log1p(5) =  1.791759469228055
math.log1p(100) =  4.61512051684126
math.log1p(125) =  4.836281906951478
math.log1p(125) / math.log10(5) =  2.6991803252671502
math.log1p(math.pi) =  1.4210804127942926
math.log1p(1000) =  6.90875477931522
math.log1p(0.001) =  0.0009995003330835331

'''

 



answered Oct 18, 2017 by avibootz
...