CKTIS / Python
math.log10
Computes the base-ten logarithm of a positive real value.
Version: Python 3.14; repository image, production runtime not attested
Syntax
math.log10(x, /)Computes the base-ten logarithm of a positive real value.
One maps to zero. Zero and negative arguments are outside the real domain.
Use the decimal logarithm to read an order of magnitude. Since 10³ = 1000 the first float is 3.0; 10⁰ = 1 gives 0.0. Zero and negative real inputs raise ValueError. Positive fractions below one give negative logarithms.
import math
assert math.log10(1000) == 3.0 and math.log10(1) == 0.0
assert math.log10(0.1) == -1.0
Examples
import math
print(math.log10(1000))
print(math.log10(1))
Result
3.0 0.0
Use the decimal logarithm to read an order of magnitude. Since 10³ = 1000 the first float is 3.0; 10⁰ = 1 gives 0.0. Zero and negative real inputs raise ValueError. Positive fractions below one give negative logarithms.