math.exp()複素数では機能しません:
>>> math.exp (math.pi*1j)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't convert complex to float
意図したとおりに動作するため、これは私をあまり傷つけません**:
>>> math.e ** (math.pi*1j)
(-1+1.2246467991473532e-16j)
今問題は対数にあります。math.log負の数では機能しません:
>>> math.log(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: math domain error
(期待される結果: (0+3.141592653589793j))
結果が複雑なPythonで対数を計算するにはどうすればよいですか? (できれば自分で実装せずに)