Random832 <random...@fastmail.com>: > On Thu, Jan 21, 2016, at 09:31, Marko Rauhamaa wrote: >> Maybe: >> >> def intdiv(a, b): >> return a // b if (a < 0) == (b < 0) else -(-a // b) > > Personally, I like a // b + (a % b and a ^ b < 0) - I've done the > opposite in C to get python-style division.
Well, then there's: def intdiv(a, b): return int(a / b) Marko -- https://mail.python.org/mailman/listinfo/python-list