git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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)
3

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"?-)

-- 
Greg