In a new worksheet (I'm using Excel 2013), starting in the top left, I type:
| A | B | C |
|---|---|---|
| =18.6 + 67.2 | =A1-85.8 = 0 | =(A1-85.8) * 1000000000000 |
Expectation
| A | B | C |
|---|---|---|
| 85.8 | TRUE | 0 |
Actual Result
| A | B | C |
|---|---|---|
| 85.8 | FALSE | 0.014210855 |
I'm well aware that floating-point numbers can behave like this, but I'm still surprised at it happening with such simple operations on numbers each having a low number of significant figures and similar orders of magnitude.
Can anyone explain why this happens and why it only happens with some pairs of values (and always non-integers)?
A number of rows filled like this (and repeated use of F9):
| A | B | C | D | E |
|---|---|---|---|---|
=RANDBETWEEN(10, 1000)/10 |
=RANDBETWEEN(10, 1000)/10 |
=A1 + B1 |
=C1-ROUND(C1,1)=0 |
=(C1-ROUND(C1,1)) * 1000000000000 |
helps demonstrate the apparent random nature of this phenomenon.