[Numpy-discussion] Infinity definitions

Michael McNeil Forbes mforbes at physics.ubc.ca
Tue Jul 15 21:55:13 EDT 2008


On 15 Jul 2008, at 6:33 AM, Bruce Southey wrote:

> Hi,
> Following Travis's suggestion below, I would like to suggest that the
> following definitions be depreciated or removed in this forthcoming  
> release:
>
> numpy.Inf
> numpy.Infinity
> numpy.infty
> numpy.PINF
> numpy.NAN
> numpy.NaN
...

While this is being discussed, what about the "representation" of  
nan's an infinities produced by repr in various forms?  It is  
particularly annoying when the repr of simple numeric types cannot be  
evaluated.  These include:

'infj'    == repr(complex(0,inf))
'nanj'    == repr(complex(0,nan))
'infnanj' == repr(complex(inf,nan))
'nannanj' == repr(complex(nan,nan))

It seems that perhaps infj and nanj should be defined symbols.  I am  
not sure why a + does not get inserted before nan.

In addition, the default infstr and nanstr printing options should  
also be changed to 'inf' and 'nan'.

Michael.








More information about the NumPy-Discussion mailing list