
Why Python's Integer Division Floors - mgrouchy
http://python-history.blogspot.com/2010/08/why-pythons-integer-division-floors.html
======
tzs
Cool. So many languages get it wrong it doesn't even occur to me to check any
more when learning a new language. I just assume that a mod b, where b is
positive, can produce a value less than 0, and normalize the result to [0, b).

------
acqq
"So why doesn't C do it this way? Probably the hardware didn't do this at the
time C was designed."

As far as I know, hardware still doesn't do this, if we look at the assembly
instructions of CPU's. The languages that specify it towards zero have the
advantage of being able to map the computation to the single CPU instruction.

