Bug 70251 - Calculation: extra decimals added on simple addition/subtraction
Summary: Calculation: extra decimals added on simple addition/subtraction
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-07 19:43 UTC by Andrew
Modified: 2013-10-09 09:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
As per description cell D21 with value 1580= wrong result but OK with 1580,99 (18.60 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-10-07 19:43 UTC, Andrew
Details
Excel with the same "problem" (163.95 KB, image/png)
2013-10-07 21:13 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2013-10-07 19:43:46 UTC
Created attachment 87253 [details]
As per description cell D21 with value 1580= wrong result but OK with 1580,99

While doing simple addition and subtraction of numbers (all directly entered via keyboard with maximun two decimal digits), the spreadsheet suddenly reports results with active decimal digits in the 8th position. This while doing simple additions and subtractions.

In the attached file if you place the value 1580 in cell D21 the result of the addition in cell J21 contains 0,000000068..... On the other hand if you use 1580,99 in cell D21 the resulting calculation is correct! Same thing in row 29.

LibreOffice in Italian: Versione 4.0.5.2 (Build ID: 5464147a081647a250913f19c0715bca595af2f)
Comment 1 Mike Kaganski 2013-10-07 21:10:00 UTC
Thank you for your report.
Unfortunately, it's a hardware limitation. And if you save the bug sheet as xls, open it in MS Excel and recalculate, you will get the same result.

See comment number 5 of Bug 63242 for clarification.
Closing as NOTABUG.
Comment 2 Mike Kaganski 2013-10-07 21:13:08 UTC
Created attachment 87258 [details]
Excel with the same "problem"
Comment 3 Tomaz Vajngerl 2013-10-09 09:16:58 UTC
Andrew: Comparing with <> or = can always be problematic because of rounding error. You can avoid this if you round you result. You have a maximum of 2 digits so if you round the result to 2 digits then it will work. Change the formula to =IF(ROUND(C21-F21;2)<>I21;"ERROR "&(C21-F21-I21);"OK")