Python math.log10()- Methode
Beispiel
Finde den Logarithmus zur Basis 10 verschiedener Zahlen
# Import math Library
import math
# Return the base-10 logarithm
of different numbers
print(math.log10(2.7183))
print(math.log10(2))
print(math.log10(1))
Definition und Verwendung
Die math.log10()
Methode gibt den Logarithmus zur Basis 10 einer Zahl zurück.
Syntax
math.log10(x)
Parameterwerte
Parameter | Description |
---|---|
x | Required. Specifies the value to calculate the logarithm for. If the value is 0 or a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
Technische Details
Rückgabewert: | Ein float Wert, der den Basis-10-Logarithmus einer Zahl darstellt |
---|---|
Python-Version: | 2.3 |