3 ms·
> Yet another reminder that floating point calculations are approximations, and not exact. floating-point calculations are absolutely exact. What's not is conv
by masklinn 7y ago
> Yet another reminder that floating point calculations are approximations, and not exact.
floating-point calculations are absolutely exact. What's not is conversions between decimals and floating-point.
- murkle 7y ago> floating-point calculations are absolutely exact Are you sure about that? What about 1.00000000000001^2 (using eg 64 bit double)?
- lifthrasiir 7y agoMaybe the parent wanted to say that the result is detetministic and not far too off from the true value (in fact, as accurate as possible given the format). In the other words FP is exact but abides by a slight different calculation rule involving rounding.
- dwheeler 7y agoFloating point is usually deterministic, but from a math point of view it is inexact (in most cases it only approximates the exact answer). In many cases that is fine, which is why it is used, but it is important to remember that.
- edflsafoiewq 7y agoTheir not being exact is why 0.49999997 + 0.5 = 1. There isn't enough precision in the range just below 1.0 to represent the number 0.99999997.