Metoda cmath.log10() Pythonu
Příklad
Najděte logaritmus se základem 10 komplexního čísla:
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Definice a použití
Metoda cmath.log10()
vrací základní-10 logaritmus komplexního čísla.
Existuje jeden řez větve, od 0 podél záporné reálné osy k -∞, spojitý shora.
Syntax
cmath.log10(x)
Hodnoty parametrů
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 |
Technické údaje
Návratová hodnota: | Hodnota complex představující 10-základní logaritmus čísla |
---|---|
Verze Pythonu: | 1.5 |