From: Travis O. <oli...@ee...> - 2006-09-19 23:53:35
|
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. As mentioned before we translate integer division errors into floating-point erros and use the same hardware trapping to trap them if the user requests it. Simulating and "integer-division-by-zero" hardware flag is not trivial as we would have to manage context switching ourselves. So, at least for 1.0, integer and floating-point division by zero are going to be handled the same. -Travis |