trouble with complex numbers

  • Thread starter Dr. Phillip M. Feldman
  • Start date
D

Dr. Phillip M. Feldman

When I try to compute the phase of a complex number, I get an error message:

In [3]: from cmath import *
In [4]: x=1+1J
In [5]: phase(x)
<snip>
NameError: name 'phase' is not defined
<snip>
AttributeError: 'complex' object has no attribute 'phase'

Any advice will be appreciated.
 
A

alex23

When I try to compute the phase of a complex number, I get an error message:
[...]
Any advice will be appreciated.

1. What version of Python are you using, and on what platform?

2. What you snipped is necessary to help debug your problem.

3. Do you have a cmath.py in the folder you're running the interpreter
in?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top