The following expression evaluates to false
in C#:
(1 + 1 + 0.85) / 3 <= 0.95
And I suppose it does so in most other programming languages which implement IEEE 754, since (1 + 1 + 0.85) / 3
evaluates to 0.95000000000000007
, which is greater than 0.95
.
However, even though Excel should implement most of IEEE 754 too, the following evaluates to TRUE in Excel 2013:
= ((1 + 1 + 0.85) / 3 <= 0.95)
Is there any specific reason for that? The article linked above does not mention any custom implementations of Excel that can lead to this behavior. Can you tell Excel to strictly round according to IEEE 754?
Please note that even though most Excel questions should be asked on superuser.com, this question deals with floating-point arithmetic, which is a common problem in programming languages. From the viewpoint of this question's topic, Excel is a programming language like C# or Java.