Re: [Numpy-discussion] reciprocal(0)

2009-06-06 Thread Ralf Gommers
You're right, that's a little inconsistent. I would also prefer to get an overflow for divide by 0 rather than casting to zero. - ralf On Sun, Jun 7, 2009 at 12:22 AM, wrote: > On Sat, Jun 6, 2009 at 11:49 PM, Ralf Gommers > wrote: > > Hi, > > > > I expect `reciprocal(x)` to calculate 1/x, an

Re: [Numpy-discussion] reciprocal(0)

2009-06-06 Thread josef . pktd
On Sat, Jun 6, 2009 at 11:49 PM, Ralf Gommers wrote: > Hi, > > I expect `reciprocal(x)` to calculate 1/x, and for input 0 to either follow > the python rules or give the np.divide(1, 0) result. However the result > returned (with numpy trunk) is: > np.reciprocal(0) > -2147483648 > np.div

[Numpy-discussion] reciprocal(0)

2009-06-06 Thread Ralf Gommers
Hi, I expect `reciprocal(x)` to calculate 1/x, and for input 0 to either follow the python rules or give the np.divide(1, 0) result. However the result returned (with numpy trunk) is: >>> np.reciprocal(0) -2147483648 >>> np.divide(1, 0) 0 >>> 1/0 Traceback (most recent call last): File "", lin