numpy bug?
Warren B. Focke
moron at Glue.umd.edu
Fri Jun 16 21:05:11 EDT 2000
Huaiyu Zhu sez:
[Numeric and Python integer division don't agree.]
Numeric just calls the C operators for / and %. C leaves the
rounding direction for integer division up to the implementor if both
operands are not positive, but does require that (a/b)*b + a%b == a as
long as b != 0. So NumPy gets it right from that point of view.
Python does specify the rounding direction, in a manner that
has been extensively argured in this group to be correct. I don't
really remember the reasons at the moment, check dejanews, it's on
there somewhere, I'm sure.
Warren Focke
--
If you feel that you have both feet planted on level ground, then the
university has failed you. -Robert Goheen, President, Princeton University
More information about the Python-list
mailing list