(Numeric) should -7 % 5 = -2 ?

Fredrik Lundh fredrik at pythonware.com
Sat Jun 28 17:45:00 EDT 2003


Stan Heckman wrote:

> Is the following behavior expected, or have I broken my Numeric
> installation somehow?
>
> $ python
> >>> import Numeric
> >>> Numeric.__version__
> '23.0'
> >>> -7 % 5
> 3
> >>> Numeric.array(-7) % 5
> -2
> >>> Numeric.remainder(-7, 5)
> -2

looks like Numeric implements C semantics, which is different
from how Python does it.

</F>








More information about the Python-list mailing list