On Mar 8, 9:19 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> Obvious typo: -(-a)//b == a//b
>
> This should be -(-a//b) == -((-a)//b)

Yes:  thanks for the correction!

A lesson to me to include parentheses even when redundant...

This reminds me of the following parenthesization gem
(see next to last line):

def isqrt(n):
    """Find the closest integer to sqrt(n), for n a positive
integer."""
    a, b = n, 1
    while a != b:
        a, b = a -- n // a >> 1, a
    return a

Mark
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to