Negative division bug?

Michael Yanowitz m.yanowitz at kearfott.com
Thu Aug 3 13:51:12 EDT 2006


Hello:

  Just wondering if this is a bug, is this as designed,
or do I have to import math or something to make it correct:

   I was just screwing around.
and found:
>>> -1/100
-1
  Shouldn't it be zero?
1/100  returns 0
but -1/ANY_POSITIVE_INTEGER_NUMBER
  returns -1

>>> -10/3
-4

   It behaves correct for positive numbers, but for negative
integers it seems to subtract one from the expected result.


Thanks in advance:
Michael Yanowitz





More information about the Python-list mailing list