EN
Python - math.log10() method example
0 points
The math.log10()
method returns the logarithm with base 10 of a number.
xxxxxxxxxx
1
import math
2
3
# Logarithm with base 10:
4
# x y
5
print(math.log10( 1 ) ) # 0
6
print(math.log10( 3 ) ) # 0.47712125471966244
7
print(math.log10( 10 ) ) # 1
8
print(math.log10( 100 ) ) # 2
9
print(math.log10( 1000 ) ) # 3
10
11
print(math.log10(-1)) # ValueError
12
print(math.log10(0)) # ValueError
13
print(math.log10(math.inf)) # inf
The math.log10()
method is presented on the following chart:

Syntax |
xxxxxxxxxx 1 math.log10(x) |
Parameters | x - double value in the range 0 to infinity . |
Result |
If If If |
Description |
|