[Numpy-discussion] 0/0 is 0 or nan?
Tue Mar 13 04:10:04 CDT 2007
> Thank you both for your replies - the difference is clear to me now.
Actually, sorry, I'm still confused!
If I want to be able to have a/0 be inf (for a!=0), then why does that
stop 0/0 from being nan?
In Python, a/0 gives a divide-by-zero error for any a, but in numpy, I
can ignore divide-by-zero errors. If I do this, why can't I still have
0/0 be nan?
gives nan, so why doesn't
also give nan, rather than 0 as it gives now? Is this because inf is not
something to which an int can be set (as Christopher Barker wrote), and
it matches Python's behavior?
I'm not at all knowledgeable in this area - I'm not requesting any
changes, just some more explanation.
More information about the Numpy-discussion