4 ms·
All floating point numbers are rational, but not all rational numbers are floating-point, including very simple ones like 1/3, and ones common in finance like 1
by taejo 8y ago
All floating point numbers are rational, but not all rational numbers are floating-point, including very simple ones like 1/3, and ones common in finance like 1/100, which is the point.
- mlvljr 8y agoFixed or floating?
- boomlinde 8y ago1/3 and 1/100 are perfectly representable using floating point. Sure, I've never seen fp in base 3 in the wild, but base 10 isn't unusual for the exact reason you're pointing out. So what I see is a conclusion that floating point is "emulated reals" as opposed to rationals, despite all floating point numbers being rational numbers and that decimal floating point is wrong and "the worst of both worlds", but I don't see a valid argument for it.