Méthode Python cmath.log10()
Exemple
Trouver le logarithme en base 10 d'un nombre complexe :
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Définition et utilisation
La cmath.log10()
méthode renvoie le logarithme en base 10 d'un nombre complexe.
Il y a une branche coupée, de 0 le long de l'axe réel négatif à -∞, continue d'en haut.
Syntaxe
cmath.log10(x)
Valeurs des paramètres
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 |
Détails techniques
Valeur de retour : | Une complex valeur, représentant le logarithme en base 10 d'un nombre |
---|---|
Version Python : | 1.5 |