On Thu, Jun 26, 2014 at 9:24 PM, Chris Angelico <ros...@gmail.com> wrote:
> But you're right that this can be very surprising. And it's inherent
> to the concept of digits having more range than just "high" or "low",
> so there's no way you can get this with binary floats.

For an average of two numbers, I think that's true.  For an average of
more than two numbers, it's possible.

>>> a = 2.0 ** 53 - 1
>>> b = 2.0 ** 53 - 2
>>> a
9007199254740991.0
>>> b
9007199254740990.0
>>> (a + b + b) / 3
9007199254740989.0
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to