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

Stan Heckman stan at stanheckman.com
Sat Jun 28 19:00:06 CEST 2003


Is the following behavior expected, or have I broken my Numeric
installation somehow?

$python
Python 2.2.2 (#1, Mar 21 2003, 23:01:54)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Numeric
>>> Numeric.__version__
'23.0'
>>> -7 % 5
3
>>> Numeric.array(-7) % 5
-2
>>> Numeric.remainder(-7, 5)
-2

-- 
Stan




More information about the Python-list mailing list