Metoda Python math.log10().
Příklad
Najděte základní-10 logaritmus různých čísel
# 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))
Definice a použití
Metoda math.log10()
vrací základní-10 logaritmus čísla.
Syntax
math.log10(x)
Hodnoty parametrů
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 |
Technické údaje
Návratová hodnota: | Hodnota float představující 10-základní logaritmus čísla |
---|---|
Verze Pythonu: | 2.3 |