[Python-Dev] Change in Python 3's "round" behavior

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Sep 27 01:55:07 EDT 2018

jab at math.brown.edu wrote:
> I understand from
> https://github.com/cosmologicon/pywat/pull/40#discussion_r219962259
> that "to always round up... can theoretically skew the data"

*Very* theoretically. If the number is even a whisker bigger than
2.5 it's going to get rounded up regardless:

 >>> round(2.500000000000001)

That difference is on the order of the error you expect from
representing decimal fractions in binary, so I would be surprised
if anyone can actually measure this bias in a real application.

>>It is a common knowledge that rounding half-to-even is what users want in most cases
> I don't think that's common knowledge; seems like citation needed?

It's not common enough for me to have heard of it before.

(BTW, how do you provide a citation for "common knowledge"?-)


More information about the Python-Dev mailing list