Working with the set of real numbers

Chris Angelico rosuav at
Tue Mar 4 13:43:53 CET 2014

On Tue, Mar 4, 2014 at 10:05 PM, Gregory Ewing
<greg.ewing at> wrote:
> Chris Angelico wrote:
>> In constant space, that will produce the sum of two infinite sequences
>> of digits.
> It's not constant space, because the nines counter
> can grow infinitely large.

Okay, okay, technically yes. But the counter can go a long way up
before it takes up any additional space, so all that's really saying
is that this has a major flaw with anything that produces a long
stream of nines. It can't tell the difference between
.99999999999999998 and .999999999999999999999999[11] where the 11
suddenly carries and it has to flip it all back.

Anyway, that was like ten minutes' knocking-together work, you can't
expect it to be perfect. I'm amazed it even worked. :)


More information about the Python-list mailing list