4 ms·
Guido has written a blog post explaining "Why Python's Integer Division Floors" [1]. Python also uses floor division, and the corresponding "sign-of-modulo mat
by bakery2k 8y ago
Guido has written a blog post explaining "Why Python's Integer Division Floors" [1].
Python also uses floor division, and the corresponding "sign-of-modulo matches sign-of-divisor", for floating-point numbers. The blog post claims that this can be problematic in certain cases (compared to C's "sign-of-modulo matches sign-of-dividend"), but does not give any concrete examples.
[1] http://python-history.blogspot.com.au/2010/08/why-pythons-integer-division-floors.html http://python-history.blogspot.com.au/2010/08/why-pythons-in...