rusi writes: > On Dec 14, 1:56 pm, Jussi Piitulainen <jpiit...@ling.helsinki.fi> > wrote: > > > > Is someone saying that _division_ is not defined because -42 div -5 is > > somehow both 9 and 8? Hm, yes, I see that someone might. The two > > operations, div and rem, need to be defined together. > ----------------------------- > Haskell defines a quot-rem pair and a div-mod pair as follows: > (from http://www.haskell.org/onlinereport/basic.html) > > (x `quot` y)*y + (x `rem` y) == x > (x `div` y)*y + (x `mod` y) == x > > `quot` is integer division truncated toward zero, while the result of > `div` is truncated toward negative infinity.
Exactly what I mean. (I gave an incorrect equation but meant this.) -- http://mail.python.org/mailman/listinfo/python-list