On Fri, Jul 3, 2015 at 1:26 AM, Paul Rubin <no.email@nospam.invalid> wrote: > Steven D'Aprano <st...@pearwood.info> writes: >> x = 1 - 1/2**53 >> assert x == 0.9999999999999999 > > In Python 2.x I don't see how that assert can possibly succeed, since > x is the integer 1. But I tested it anyway on 2.7.5 under Fedora 19 > and it threw an assertion error.
>From previous discussions I happen to know that Steven normally runs everything with "from __future__ import division" active (and possibly others? not sure), so just assume he means to work with floats here. Steven, I think this is one of the downsides of using future directives by default - you forget that your code can't always be copied and pasted to other people :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list