[Numpy-discussion] Infinity as nan as real part
Charles R Harris
charlesr.harris@gmail....
Wed Jun 25 14:13:35 CDT 2008
On Wed, Jun 25, 2008 at 6:42 AM, Stéfan van der Walt <stefan@sun.ac.za>
wrote:
> Hi all,
>
> Why can't a person construct a complex number with an infinite complex
> part and a zero real part?
>
> 1 + 1j*np.inf == (nan + infj) # because np.inf * 1j == (nan + infj)
>
> There is a workaround:
>
> z = np.array([0], dtype=complex)
> z.imag = np.inf
>
> but that's not very pleasant.
>
> Is this a bug, or intended behaviour?
>
Probably a bug.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080625/bb279829/attachment.html
More information about the Numpy-discussion
mailing list