Working with the set of real numbers

Chris Angelico rosuav at gmail.com
Wed Feb 12 10:16:36 CET 2014


On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> So, if I understand you right, you want to say that you've not found a
> computer that works with the *complete* set of real numbers. Yes?

Correct. When jmf referred to real numbers, he implied that there are
no optimizations done for natural numbers, that everything's just as
efficient for any real number as for any other. My point is that
computers *do not* work with real numbers, but only ever with some
subset thereof, and that certain subsets (integers usually) are
optimized for in ways that other subsets aren't.

A true "real number" type might be useful in a few extremely narrow
situations, but for the most part, I'd much rather have the optimized
implementation that works with a subset thereof, and actually runs
within reasonable time/space complexity. (Though, that said, I think a
lot of programmers could do with some education on exactly _what_
subset of real numbers they're working with. The classic IEEE
double-precision floating point type is good enough with low numbers
that lots of people seem to think it stores reals, which it doesn't.)

ChrisA



More information about the Python-list mailing list