Phương thức Python cmath.log10 ()
Thí dụ
Tìm logarit cơ số 10 của một số phức:
#Import cmath Library
import cmath
#print base-10 log value of
complex numbers
print (cmath.log10(2+ 3j))
print (cmath.log10(1+ 2j))
Định nghĩa và Cách sử dụng
Phương cmath.log10()
thức trả về logarit cơ số 10 của một số phức.
Có một nhánh bị cắt, từ 0 dọc theo trục thực âm đến -∞, liên tục từ trên xuống.
Cú pháp
cmath.log10(x)
Giá trị tham số
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 |
Chi tiết kỹ thuật
Giá trị trả lại: | Một complex giá trị, đại diện cho lôgarit cơ số 10 của một số |
---|---|
Phiên bản Python: | 1,5 |