Integer division, surprising results

Rory Geoghegan rory_geoghegan at yahoo.com
Mon May 10 13:41:30 EDT 2004


> I've looked at faqs and documentation, and nothing jumped out at me. Can
> anyone explain the reasoning for this?

According to my math book integer division is defined as such:
a/b = q, where a = b*q + r and r is the remainder.

A remainder (ei a modulo) is always positive, effectively flooring all
the division operations.



More information about the Python-list mailing list