Python - Methode cmath.log10()
Beispiel
Finde den Logarithmus zur Basis 10 einer komplexen Zahl:
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Definition und Verwendung
Die cmath.log10()
Methode gibt den Logarithmus zur Basis 10 einer komplexen Zahl zurück.
Es gibt einen Zweigschnitt, von 0 entlang der negativen reellen Achse bis -∞, durchgehend von oben.
Syntax
cmath.log10(x)
Parameterwerte
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 |
Technische Details
Rückgabewert: | Ein complex Wert, der den Basis-10-Logarithmus einer Zahl darstellt |
---|---|
Python-Version: | 1.5 |