Stefan Behnel added the comment:

Meaning, something like this should work:

    x = (nom * 10**(prec+1)) // den
    if x % 10 < 5:
       x = x // 10
    else:
       x = x // 10 + 1
    print('%s.%s' % (x[:-prec], x[-prec:]))

----------

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

Reply via email to