19 Sep
2006
19 Sep
'06
7:13 p.m.
Charles R Harris wrote:
Travis,
Is this intentional?
In [77]: arange(5, dtype=int)/0 Out[77]: array([0, 0, 0, 0, 0])
It looks deliberate because all zeros are returned, but it might be better if it raised an exception.
It is deliberate. Numarray introduced it (the only difference being that by default NumPy has division-by-zero erros turned off). It's tied to the way floating-point division-by zero is handled. There is a valid argument for having a separate integer-division flag so that you can raise exceptions for integer-division but not for floating-point division. I'm open to that change for 1.0rc1 -Travis