Python Math.log10() Metoda
Przykład
Znajdź logarytm dziesiętny różnych liczb
# 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))
Definicja i użycie
Metoda math.log10()
zwraca logarytm dziesiętny liczby.
Składnia
math.log10(x)
Wartości parametrów
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 |
Szczegóły techniczne
Wartość zwrotu: | Wartość float reprezentująca logarytm dziesiętny liczby |
---|---|
Wersja Pythona: | 2,3 |