
The Numpy version of modulo uses a different sign convention for negative arguments than does Python itself:
(Numpy version 20.2.0, Python version 1.5.2 and version 2.2a4.) Is there a reason for this (hard to imagine), or is this a bug? Eric

On Fri, 12 Oct 2001, Eric Nodwell wrote:
Speed. In Python, there's so much overhead from symbol resolution, looking up __mod__s and __rmod__s and whatnot that the extra work is lost in the noise. Numpy would take a bigger hit when working with large arrays. One could always write python_compatible_div and python_compatible_mod functions, if one wanted. Could even submit a patch to add them, if truly motivated. Warren Focke

On Fri, 12 Oct 2001, Eric Nodwell wrote:
Speed. In Python, there's so much overhead from symbol resolution, looking up __mod__s and __rmod__s and whatnot that the extra work is lost in the noise. Numpy would take a bigger hit when working with large arrays. One could always write python_compatible_div and python_compatible_mod functions, if one wanted. Could even submit a patch to add them, if truly motivated. Warren Focke
participants (2)
-
Eric Nodwell
-
Warren Focke