3 ms·
IEEE 754 is well defined so that $a+b=b+a$ But it can't give you warranty that $(a+b)+c=a+(b+c)$ (well known error propagation issue)
by gilcot 3y ago
IEEE 754 is well defined so that $a+b=b+a$
But it can't give you warranty that $(a+b)+c=a+(b+c)$ (well known error propagation issue)
- BeetleB 3y agoIEEE guarantees commutativity, but does not guarantee the correctness of a+b. My point is that floating point numbers are real numbers, but the usual operations on them will not give you the same results as the operations on real numbers.
- nayuki 3y agoIEEE does guarantee the correctness of a+b in the sense that it will return the floating-point number that is closest to the real number that would've been computed with infinite precision. There's no randomness or fuzziness in floating-point rounding.
- BeetleB 3y ago> IEEE does guarantee the correctness of a+b in the sense that it will return the floating-point number that is closest to the real number that would've been computed with infinite precision. Until you deal with overflow. And to be frank, this is just redefining "correctness". If you want to view FPs as real numbers (which they are), there's nothing wrong with pointing out that real number operations will give you incorrect results (even ignoring overflow). > There's no randomness or fuzziness in floating-point rounding. I did not imply there was.
- gilcot 3y agoFP are part of R, like Q or D sets. (I think it should be considered/seen as a subset of decimal numbers set.)
- BeetleB 3y agoNothing I said implied they weren't.