CKTIS / Python
math.log10
Berechnet den Zehnerlogarithmus zum Vergleich von Größenordnungen.
Version: Python 3.14; repository image, production runtime not attested
Syntax
math.log10(x, /)Berechnet den Zehnerlogarithmus zum Vergleich von Größenordnungen.
Aus 10³ = 1000 folgt 3,0 und aus 10⁰ = 1 folgt 0,0. Positive Brüche unter eins haben negative Logarithmen.
Null und negative Eingaben lösen ValueError aus.
import math
assert math.log10(1000) == 3.0 and math.log10(1) == 0.0
assert math.log10(0.1) == -1.0
Beispiele
import math
print(math.log10(1000))
print(math.log10(1))
Ergebnis
3.0 0.0
Null und negative Eingaben lösen ValueError aus.