I am encountering a floating point error with a very simplistic arithmetic problem in R:
17.1 - 5.9 - 11.2
5.9 + 11.2 - 17.1
yields 1.776357e-15
and 0
, respectively. I've encountered these problems when I've had very large or very small numbers, but these are only non-zero to the tenths place.
Why am I getting different results?
This question is different than Why are these numbers not equal? because I am performing the same number of operations (2) in each equation, with the difference being a single plus/minus sign. I am curious why.
Thanks so much for your help in advance!
Oh, also using R v.3.5.1 on macOS v.10.13.6.