【发布时间】:2011-12-14 00:50:44
【问题描述】:
我可以在 python 中计算 exp(1+2j) 吗?
exp(1+2j)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't convert complex to float
【问题讨论】:
我可以在 python 中计算 exp(1+2j) 吗?
exp(1+2j)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't convert complex to float
【问题讨论】:
【讨论】:
您可能需要从数学模块导入 e 来执行此操作。
例如:
>>> from math import e
>>> print e ** (1+2j)
(-1.1312043837568135+2.4717266720048188j)
【讨论】: