[Python-ideas] Round division

Serhiy Storchaka storchaka at gmail.com
Fri Sep 11 08:27:15 CEST 2015


On 11.09.15 06:13, Steven D'Aprano wrote:
> How does this differ from round(a/b)? round() also rounds to even.

 >>> round(5000000000000000/9999999999999999)
0
 >>> round(14999999999999999/10000000000000000)
2

But fractions 5000000000000000/9999999999999999 > 1/2 and 
14999999999999999/10000000000000000 < 3/2.




More information about the Python-ideas mailing list