How to calculate the base 10 logarithm of a number in Python

1 Answer

0 votes
import math

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


'''
run:

math.log10(1) =  0.0
math.log10(5) =  0.6989700043360189
math.log10(100) =  2.0
math.log10(125) =  2.0969100130080562
math.log10(125) / math.log10(5) =  2.9999999999999996
math.log10(math.pi) =  0.49714987269413385
math.log10(1000) =  3.0
math.log10(0.001) =  -3.0

'''

 



answered Oct 18, 2017 by avibootz
edited Oct 18, 2017 by avibootz

Related questions

1 answer 178 views
178 views asked Feb 8, 2020 by avibootz
2 answers 338 views
3 answers 349 views
1 answer 293 views
...