Python cmath.log10() Metode
Voorbeeld
Vind die basis-10 logaritme van 'n komplekse getal:
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Definisie en gebruik
Die cmath.log10()
metode gee die basis-10-logaritme van 'n komplekse getal terug.
Daar is een tak gesny, van 0 langs die negatiewe reële as tot -∞, kontinu van bo af.
Sintaksis
cmath.log10(x)
Parameterwaardes
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 |
Tegniese besonderhede
Terugkeerwaarde: | 'n complex Waarde wat die basis-10-logaritme van 'n getal voorstel |
---|---|
Python weergawe: | 1.5 |