[Python-Dev] Vacation and possibly a new bug
Brett C.
drifty@alum.berkeley.edu
Tue, 22 Jul 2003 16:43:08 -0700
Tim Peters wrote:
> [Brett]
>
>>>>And why does ``t = (time((time_t *)0) / YEAR) * YEAR;`` on line 608
>>>>have to divide by YEAR and then multiply by YEAR? Shouldn't those
>>>>cancel out?
>
>
> [Guido]
>
>>>I guess it should have used // instead of /. (X//Y)*Y is a standard
>>>way to round X down to a whole multiple of Y, and I presume that's
>>>what the code here does.
>
>
> [Brett]
>
>>Didn't know C had a flooring divide operator. Good to know.
>
>
> It doesn't. If Guido were still my boss, I'd say he was pulling your leg.
> But since he left us, I'll just diplomatically say he's an idiot <wink>.
>
=) But he is still your BDFL so be careful how to tread, Tim. =)
> If dividend and divisor are both positive and integer, C's / is flooring
> division.
>
That's what I figured. Although isn't that assuming time_t is an int or
long or something? But the entire chunk of code seems to assuming that
so what is one more spot of code. =)
-brett