3 ms·
> Rational arithmetic satisfies (a+b)+c=a+(b+c); floating point arithmetic does not. Therefore floats are not a subset of rationals. This reasoning is not soun
by klodolph 5y ago
> Rational arithmetic satisfies (a+b)+c=a+(b+c); floating point arithmetic does not. Therefore floats are not a subset of rationals.
This reasoning is not sound. The conclusion is only correct by accident.
The reason floats are not a subset of the rationals is because floats distinguish positive and negative zero, and because floats represent non-finite values (NaN and infinity).
The fact that floating-point operations are not commutative is a consequence of the fact that floating-point numbers are not a "subring" of the rational numbers, not a consequence of the fact that the floating-point numbers are not a subset of the rationals. You could easily take a subset of the floating-point numbers that is also a subset of the rationals, it would still not be associative (assuming it contains at least two different elements).
Here is the concept you are looking for:
https://en.wikipedia.org/wiki/Subring https://en.wikipedia.org/wiki/Subring
- deleted 5y ago[deleted]