Working with the set of real numbers (was: Finding size of Variable)

Jussi Piitulainen jpiitula at ling.helsinki.fi
Wed Feb 12 04:23:21 EST 2014


Chris Angelico writes:
> On Wed, Feb 12, 2014 at 7:17 PM, Ben Finney wrote:
> > What specific behaviour would, for you, qualify as “works with the
> > set of real numbers in any way”?
> 
> Being able to represent surds, pi, e, etc, for a start. It'd
> theoretically be possible with an algebraic notation (eg by carrying
> through some representation like "2*pi" rather than 6.28....), but
> otherwise, irrationals can't be represented with finite storage and
> a digit-based system.

I've seen papers on exact computable reals that would, in effect,
generate more precision when needed for some operation. It wasn't
symbolic like 2pi, more like 6.28... with a promise to delve into the
ellipsis, and some notable operations not supported.

Equality testing was missing, I think, and I think it could not be
known in general whether such a number is positive, zero or negative,
so even approximate printing in the usual digit notation would not be
possible. (Interval arithmetic, I hear, has a similar problem about
not knowing the sign of a number.)

In stark contrast, exact rationals work nicely, up to efficiency
considerations.



More information about the Python-list mailing list