2

In Excel 2007/2010, I get this strange behaviour:

Formula in cell: =2.6+1.4+4.62-8.2
Result in cell: 0.420000000000002000

Weird extra '2' about 14DP in. Can anyone explain why this is happening please?

4
  • 3
    This is likely the result of floating point calculations. (Computers to not usually calculate in the decimal system. Instead they use binary, often about 80 bits deep binary. That is usually close enough but it is not precise and it leads to rounding errors).
    – Hennes
    May 18, 2015 at 16:25
  • 1
    This is indeed due to the decmial calculations and is not a bug.
    – Ramhound
    May 18, 2015 at 16:34
  • 1
    Here is a decent MS KB on the topic: support.microsoft.com/en-us/kb/214118
    – Byron Wall
    May 18, 2015 at 16:35
  • Probably because computer floating point math is in reality inexact, and gets worse the further out you go in decimal places.
    – Oort
    May 18, 2015 at 16:38

1 Answer 1

1

As mentioned in the comments, this is not a bug. It is due to the inevitable inaccuracy of floating point arithmetic due to the finite number of bits available to store values, resulting in an approximate representation which becomes apparent the more significant digits you choose to display.

Here are some useful articles for you:

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .