| 1 | initial version |
The error is caused by executing r=w.imag() where it happens that w is not of complex type but a floating point number. To make it work in all cases, you may like to add conversion of w into a complex type before extracting its imaginary part:
r=CC(w).imag()
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.