Python cmath.log10() Metodo
Esempio
Trova il logaritmo in base 10 di un numero complesso:
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Definizione e utilizzo
Il cmath.log10()
metodo restituisce il logaritmo in base 10 di un numero complesso.
C'è un ramo tagliato, da 0 lungo l'asse reale negativo a -∞, continuo dall'alto.
Sintassi
cmath.log10(x)
Valori dei parametri
Parameter | Description |
---|---|
x | Required. Specifies the value to calculate the base-10 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 complex valore, che rappresenta il logaritmo in base 10 di un numero |
---|---|
Versione Python: | 1.5 |