Python cmath.log10() Metode
Contoh
Menemukan logaritma basis-10 dari bilangan kompleks:
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Definisi dan Penggunaan
Metode cmath.log10()
ini mengembalikan logaritma basis-10 dari bilangan kompleks.
Ada satu cabang yang dipotong, dari 0 sepanjang sumbu real negatif ke -∞, kontinu dari atas.
Sintaksis
cmath.log10(x)
Nilai Parameter
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 |
Detail Teknis
Nilai Kembali: | Nilai complex , yang mewakili logaritma basis-10 dari suatu bilangan |
---|---|
Versi Python: | 1.5 |