Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What makes you think any arbitrary real number qualifies as a “floating point number”?

I have never seen the term used in anything like that context.

To me, the term “floating point number” is about number representation, not number identity. It is an inherently finite quantity in every instance I’ve ever seen.

Examples of floating point numbers: The sexagesimal cuneiform 42 25 35 written on the Babylonian tablet YBC 7289; 3.1415 × 10⁰; 1.010101010101₂ >> 2.

Not examples of floating point numbers (in my opinion): 1/√2; π, 1/3.



The GP is claiming that all possible floating point systems, taken together, would contain the same number of values as there are points on the real line.

Consider a floating point system based on https://en.wikipedia.org/wiki/Golden_ratio_base


Thanks! To be just a bit more precise, I am claiming that all possible floating point systems, taken together, would contain the same number of values in [0,1] as there are points on the real line.


Hmmm, I missed that wrinkle. My grasp of this slightly unusual topic is not 100% reliable, and so I'm now wondering whether the cardinality of the set you describe is different from the cardinality of the set of all possible floating point numbers.


Nobody uses "floating point number" to mean "a number that could theoretically exist in a floating point system I will invent for you after you tell me the number". That's not being pedantic, that's insisting on a wrong definition.


Nobody uses "floating point number" to mean "a number that could theoretically exist in a floating point system I will invent

Put a full stop there -- Oh yes, people do mean that! Most of the time, people are referring to a bit representation in a specific system like IEEE's.

a floating point system I will invent for you after you tell me the number"

The above part of the sentence isn't a definition of "floating point number." It's how I use the common notion of "floating point number" in my argument. Your objection only looks like it works because you conflate the two concepts. If you don't conflate the two concepts, then you are arguing that most low level programming that deals with 32 bit floats doesn't actually deal with "floating point numbers." That is a reasonable assertion for a reasonable set of definitions. However, it's not the one I'm using, which also fits the reality of the mental models most people are actually using.

In terms of program correctness, you can find many examples where using an abstract concept of "floating point" instead of the concrete representation will produce errors. So then why is it "the correct one" as you say?


I can't parse what you're saying. What two concepts are you accusing me of conflating?

There are many different floating point systems, but they all share certain attributes. None of them can exactly represent sqrt([insert large prime]). If you want to invent a bunch of such systems post-facto, you are abusing the term. The union of all systems that can reasonably be called "floating point" is not the set of real numbers. It's countable, as a very loose upper bound.


You can make an exception for a particular bit pattern for an irrational, like Pi, just like you can use a particular bit pattern to represent -0 and NaN. Since the title doesn't specify a floating point representation, I thereby invoke all possible floating point representations. I construct a set of such representations with the cardinality of Reals like so: For any given real number X, just formulate a representation like single-precision IEEE 754 floating-point but which substitutes X for NaN.

The article doesn't fall into this trap, but the title does.

Now, if you think your objection sinks my definition of "floating point number," note that it also sinks IEEE 754 floating-point.

EDIT: So you formulate a particular definition of "floating point number" for which you are right. To which I say: So What?




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

Search: