On Fri, Jul 6, 2012 at 3:06 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > The "+ 86400" is redundant; you'll get the same answer with or without > it. There is nothing to fear from going negative when doing modulo > arithmetic, because unlike C, Python actually has well-defined > semantics regarding modulo division of negative numbers. > >>>> (13382 + 86400 - 42597) % 86400 > 57185 >>>> (13382 - 42597) % 86400 > 57185
Ah good. There's a lot of languages like that these days, but I've gotten so into the habit of not depending on it that I just automatically add N first. It's redundant but insignificant. So it's even easier than I said. And bonus lesson for the day: Try things in the interactive interpreter before you post. :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list