Why is this simple Excel calculation not netting Zero?
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
add a comment |
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
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
add a comment |
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
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
windows microsoft-excel microsoft-excel-2003 spreadsheet
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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.
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
add a comment |
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().
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
answered Apr 6 '13 at 11:11
PincopallinoPincopallino
7773919
7773919
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
add a comment |
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
add a comment |
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().
add a comment |
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().
add a comment |
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().
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().
answered Apr 6 '13 at 11:07
j rivj riv
1,11152540
1,11152540
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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