[Numpy-discussion] handling of inf
Kilian Koepsell
python at koepsell.de
Fri Jun 22 04:19:07 EDT 2007
Hi,
I was wondering if the numpy function 'isinf' should return True for
complex infinity.
I encountered the following behavior that could be considered a bug:
>>> import numpy as N
>>> N.isinf(1j*N.inf)
True
>>> 1j/(N.array(1)-1)
(nannanj)
>>> N.isinf(1j/(N.array(1)-1))
False
>>> 1j/(N.array([1])-1)
array([ nan +nanj])
>>> N.isinf(1j/(N.array([1])-1))
array([False], dtype=bool)
Thanks,
Kilian
--
Kilian Koepsell
Redwood Center for Theoretical Neuroscience
Helen Wills Neuroscience Institute, UC Berkeley
132 Barker Hall, #3190, Berkeley, CA 94720-3190
More information about the NumPy-Discussion
mailing list