Hacker News new | past | comments | ask | show | jobs | submit login

Tangent: in the real world, there are no real numbers. Whether or not there are arbitrary rational numbers is something of an open question.

"Binary number" as used by grandparent really refers to dyadic rationals (https://en.wikipedia.org/wiki/Dyadic_rational), which are a perfectly well-defined dense subset of the rationals. Similarly, "decimal number" is really "terminating decimal expansion" (or whatever you want to call the decimal analogue of dyadic rational), which is again a well-defined dense subset of the rationals. This is a perfectly valid mathematical distinction; the numbers that people work with day-to-day are much more frequently the latter.




Hrmmm. I thought something was fishy with the statement: "Tangent: in the real world, there are no real numbers". The reals are defined as the set of all rational and irrational numbers on the number line. See https://en.wikipedia.org/wiki/Real_number for a reasonably pedagogical discussion.

There are reals, they do exist. In the "real" world (as poorly defined as that is).

The issue is, fundamentally, what programming languages call "real numbers" are not real numbers. They are an approximation to a subset of the reals. This approximation has holes, and the implementations work to some degree to define regions of applicability, and regions of inapplicability. Usually people get hung up or caught in the various traps (inadvertently) added to the specs for "Reals".

Its generally better to say "floating point numbers" than "Reals" in CS, simply because floating point is that subset of the Reals that we are accustomed to using.

I definitely agree with the comment on rationals. I am a fan of Perl6, Julia and other languages ability to use rationals as first class number types.

Sadly, as with other good ideas that require people alter their code/libraries, I fear this will not catch on due to implicit momentum of existing systems.


In a very reasonable sense, the real numbers do not exist in the real world. Almost all real numbers are non-computable, so under apparently reasonable assumptions about what experiments you can conduct, there is no experiment you can do that will produce a measurement with the value of most real numbers.

From this, it’s fairly non-controvesial to say that only the computable reals exist; these are a tiny (measure-zero) subset of the reals.

If you go further and assume a fundamentally discrete universe (much more controvesial), then all you can really measure are integers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: