Python math.log10() Metodo
Esempio
Trova il logaritmo in base 10 di numeri diversi
# 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))
Definizione e utilizzo
Il math.log10()
metodo restituisce il logaritmo in base 10 di un numero.
Sintassi
math.log10(x)
Valori dei parametri
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 |
Dettagli tecnici
Valore di ritorno: | Un float valore, che rappresenta il logaritmo in base 10 di un numero |
---|---|
Versione Python: | 2.3 |