[Numpy-discussion] numpy.arccos(numpy.inf)????

Stuart Brorson sdb at cloud9.net
Fri May 16 12:47:59 EDT 2008


Hi --

Sorry to be a pest with corner cases, but I found another one.

In this case, if you try to take the arccos of numpy.inf in the
context of a complex array, you get a bogus return (IMO).  Like this:

In [147]: R = numpy.array([1, numpy.inf])

In [148]: numpy.arccos(R)
Warning: invalid value encountered in arccos
Out[148]: array([  0.,  NaN])

In [149]: C = numpy.array([1+1j, numpy.inf])

In [150]: numpy.arccos(C)
Warning: invalid value encountered in arccos
Out[150]: array([ 0.90455689-1.06127506j,         NaN       -Infj])

The arccos(numpy.inf) in the context of a real array is OK, but taking
arcocs(numpy.inf) in the context of a complex array should return 
NaN + NaNj, IMO.

Thoughts?

Stuart Brorson 
Interactive Supercomputing, inc. 
135 Beaver Street | Waltham | MA | 02452 | USA 
http://www.interactivesupercomputing.com/




More information about the NumPy-Discussion mailing list