Why is this simple Excel calculation not netting Zero?












2















enter image description here



It's supposed to be zero but for some reason the result produces a peculiar series of digits at the end.



Also, here's the .xlsx of it: http://83.212.111.36/Book1.xlsx










share|improve this question























  • I found a workaround with round(), and I heard it's a problem with floating arithmetic. I do not know if it can be fixed.

    – j riv
    Apr 6 '13 at 11:00
















2















enter image description here



It's supposed to be zero but for some reason the result produces a peculiar series of digits at the end.



Also, here's the .xlsx of it: http://83.212.111.36/Book1.xlsx










share|improve this question























  • I found a workaround with round(), and I heard it's a problem with floating arithmetic. I do not know if it can be fixed.

    – j riv
    Apr 6 '13 at 11:00














2












2








2








enter image description here



It's supposed to be zero but for some reason the result produces a peculiar series of digits at the end.



Also, here's the .xlsx of it: http://83.212.111.36/Book1.xlsx










share|improve this question














enter image description here



It's supposed to be zero but for some reason the result produces a peculiar series of digits at the end.



Also, here's the .xlsx of it: http://83.212.111.36/Book1.xlsx







windows microsoft-excel microsoft-excel-2003 spreadsheet






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 6 '13 at 10:43









j rivj riv

1,11152540




1,11152540













  • I found a workaround with round(), and I heard it's a problem with floating arithmetic. I do not know if it can be fixed.

    – j riv
    Apr 6 '13 at 11:00



















  • I found a workaround with round(), and I heard it's a problem with floating arithmetic. I do not know if it can be fixed.

    – j riv
    Apr 6 '13 at 11:00

















I found a workaround with round(), and I heard it's a problem with floating arithmetic. I do not know if it can be fixed.

– j riv
Apr 6 '13 at 11:00





I found a workaround with round(), and I heard it's a problem with floating arithmetic. I do not know if it can be fixed.

– j riv
Apr 6 '13 at 11:00










2 Answers
2






active

oldest

votes


















8














This happens because of the limited precision of floating point numbers representation on computers and cannot be fixed because it is an intrinsic problem of the way number are represented on a computer. There might be workarounds, such as round() or a clever implementation of the formulas to reduce error propagations.



Excel uses 8-byte (64 bit) floating point representation, meaning that it can achieve a maximum accuracy of about 10^-15. The inaccuracy can then spread across the steps of a calculation.



I suggest that you read this article on Wikipedia that investigates this topic.






share|improve this answer
























  • They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

    – Psycogeek
    Apr 6 '13 at 12:40













  • Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

    – Pincopallino
    Apr 8 '13 at 14:04



















3














Self post: It's a documented limitation for floating point arithmetic: http://support.microsoft.com/kb/78113



IMO it should be warning more visibly when the results can be so blatantly erroneous to not be considered a bug, but anyway.



A workaround is to use round().






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f578880%2fwhy-is-this-simple-excel-calculation-not-netting-zero%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    8














    This happens because of the limited precision of floating point numbers representation on computers and cannot be fixed because it is an intrinsic problem of the way number are represented on a computer. There might be workarounds, such as round() or a clever implementation of the formulas to reduce error propagations.



    Excel uses 8-byte (64 bit) floating point representation, meaning that it can achieve a maximum accuracy of about 10^-15. The inaccuracy can then spread across the steps of a calculation.



    I suggest that you read this article on Wikipedia that investigates this topic.






    share|improve this answer
























    • They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

      – Psycogeek
      Apr 6 '13 at 12:40













    • Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

      – Pincopallino
      Apr 8 '13 at 14:04
















    8














    This happens because of the limited precision of floating point numbers representation on computers and cannot be fixed because it is an intrinsic problem of the way number are represented on a computer. There might be workarounds, such as round() or a clever implementation of the formulas to reduce error propagations.



    Excel uses 8-byte (64 bit) floating point representation, meaning that it can achieve a maximum accuracy of about 10^-15. The inaccuracy can then spread across the steps of a calculation.



    I suggest that you read this article on Wikipedia that investigates this topic.






    share|improve this answer
























    • They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

      – Psycogeek
      Apr 6 '13 at 12:40













    • Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

      – Pincopallino
      Apr 8 '13 at 14:04














    8












    8








    8







    This happens because of the limited precision of floating point numbers representation on computers and cannot be fixed because it is an intrinsic problem of the way number are represented on a computer. There might be workarounds, such as round() or a clever implementation of the formulas to reduce error propagations.



    Excel uses 8-byte (64 bit) floating point representation, meaning that it can achieve a maximum accuracy of about 10^-15. The inaccuracy can then spread across the steps of a calculation.



    I suggest that you read this article on Wikipedia that investigates this topic.






    share|improve this answer













    This happens because of the limited precision of floating point numbers representation on computers and cannot be fixed because it is an intrinsic problem of the way number are represented on a computer. There might be workarounds, such as round() or a clever implementation of the formulas to reduce error propagations.



    Excel uses 8-byte (64 bit) floating point representation, meaning that it can achieve a maximum accuracy of about 10^-15. The inaccuracy can then spread across the steps of a calculation.



    I suggest that you read this article on Wikipedia that investigates this topic.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 6 '13 at 11:11









    PincopallinoPincopallino

    7723919




    7723919













    • They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

      – Psycogeek
      Apr 6 '13 at 12:40













    • Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

      – Pincopallino
      Apr 8 '13 at 14:04



















    • They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

      – Psycogeek
      Apr 6 '13 at 12:40













    • Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

      – Pincopallino
      Apr 8 '13 at 14:04

















    They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

    – Psycogeek
    Apr 6 '13 at 12:40







    They were using floating point on the windows calculator too to aquire new and different math :-) Simple rounding could have solutioned it. Instead I get to read 20 pages of stuff about it to find out that FP has a specific accuracy as used, and within that accuracy used, it should just be rounded back to within that accuracy. Rounded proper not chopped.

    – Psycogeek
    Apr 6 '13 at 12:40















    Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

    – Pincopallino
    Apr 8 '13 at 14:04





    Advanced users may decide if they need a rounded or truncated result based on their needs. Unnecessary rounding slows down the calculations.

    – Pincopallino
    Apr 8 '13 at 14:04













    3














    Self post: It's a documented limitation for floating point arithmetic: http://support.microsoft.com/kb/78113



    IMO it should be warning more visibly when the results can be so blatantly erroneous to not be considered a bug, but anyway.



    A workaround is to use round().






    share|improve this answer




























      3














      Self post: It's a documented limitation for floating point arithmetic: http://support.microsoft.com/kb/78113



      IMO it should be warning more visibly when the results can be so blatantly erroneous to not be considered a bug, but anyway.



      A workaround is to use round().






      share|improve this answer


























        3












        3








        3







        Self post: It's a documented limitation for floating point arithmetic: http://support.microsoft.com/kb/78113



        IMO it should be warning more visibly when the results can be so blatantly erroneous to not be considered a bug, but anyway.



        A workaround is to use round().






        share|improve this answer













        Self post: It's a documented limitation for floating point arithmetic: http://support.microsoft.com/kb/78113



        IMO it should be warning more visibly when the results can be so blatantly erroneous to not be considered a bug, but anyway.



        A workaround is to use round().







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 6 '13 at 11:07









        j rivj riv

        1,11152540




        1,11152540






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f578880%2fwhy-is-this-simple-excel-calculation-not-netting-zero%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...