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
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
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