none
Excel 2010 calculation inexact RRS feed

  • Question

  • Hello Everyone,

    It is found 

    -------------------

    Put 1.01 in one cell (for example in A1). 
    1.01*1.01*1.01=1.030301.
    However if one calculates formula 
    (1) =A1*A1*A1-A1 
    (2) =A1*(A1+1)*(A1-1)
    (3) =1.030301-A1
    (4) =1.030301-1.01

    (1),(3),(4) give 0.0203009999999999
    (2) gives 0.02030100000000000.

    If one uses (2)-(4), then Excel 2010 shows -1.14492E-16.
    The calculation can be done as the integer multiplication/subtract and should return the exact result. Only (2) gives the correct answer.

    -------------------

    Can anyone replicate this? Is it a known bug?

    Thanks.

    mercredi 7 novembre 2012 11:44

Réponses

  • Bonjour,
     
    Regarde ici (have a look here) :
     
    http://blogs.office.com/b/microsoft-excel/archive/2008/04/10/understanding-floating-point-precision-aka-why-does-excel-give-me-seemingly-wrong-answers.aspx
     
    Daniel
     
     
     
    • Marqué comme réponse Aurel Bera jeudi 8 novembre 2012 10:56
    mercredi 7 novembre 2012 12:22

Toutes les réponses