Martin v. Löwis <mar...@v.loewis.de> added the comment:

Correct me if I'm wrong, but I think computing the quotient is not
necessary; the remainder is sufficient:

def round(n, i):
    if i >= 0: return n
    i = 10**(-i)
    r = n%(2*i)
    if r < i:
        return n-r
    return n-r+2*i

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4707>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to