Re:Lies My Calculator and Computer Told Me [pdf]
by gilcot on Tuesday September 19, 2023 @01:11PM
(#37573014)
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)
[ Parent
| on HN ]
Re:Lies My Calculator and Computer Told Me [pdf]
by BeetleB on Tuesday September 19, 2023 @05:21PM
(#37576915)
IEEE 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.
Re:Lies My Calculator and Computer Told Me [pdf]
by nayuki on Tuesday September 19, 2023 @08:01PM
(#37578771)
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.
Re:Lies My Calculator and Computer Told Me [pdf]
by BeetleB on Wednesday September 20, 2023 @12:33PM
(#37586312)
> 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.