Is every double a rational number (Excluding the special values [Infinity, -Infinity, NaN])? I am leaning towards saying yes, based on the following logic:
This logic seems correct.
Computers can use only limited space, meaning they can only represent in memory rational numbers (When using
double format), as irrational numbers are composed of an infinite number of digits without repeating.
Coming to think about it, you can, however, store an executable code of a function that defines the number, rational or not, but this wouldn't work for every irrational and more importantly, isn't how
As for the special values, I don't think so. Infinity is not really a number, so I find it hard to define as rational or irrational. Same for NaN (Which is, by definition, not a number).