Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i calculate exp(1+2j) in python?

Tags:

python

math

Can i calculate exp(1+2j) in python?

exp(1+2j)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't convert complex to float
like image 796
Searene Avatar asked Dec 14 '11 00:12

Searene


1 Answers

You need a complex version of this function:

cmath.exp(1+2j)

See http://docs.python.org/library/cmath.html

like image 87
duffymo Avatar answered Sep 19 '22 11:09

duffymo