Bug 92536 - Error in formula
Summary: Error in formula
Status: RESOLVED DUPLICATE of bug 67026
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-04 04:15 UTC by geoff183
Modified: 2015-07-05 00:33 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
spreadsheet to show bug (16.87 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-07-04 04:15 UTC, geoff183
Details

Note You need to log in before you can comment on or make changes to this bug.
Description geoff183 2015-07-04 04:15:01 UTC
Created attachment 117040 [details]
spreadsheet to show bug

Open attached spreadsheet.
Enter "=A1-A2" into A3.
The result is wrong. It should be 4560.42 but it result in 4560.42000000001.
Minor error but it made a difference in my project :-)
However, enter "=A1+A2" into A4 and the correct sum is made.
Comment 1 m_a_riosv 2015-07-04 09:10:53 UTC
Hi @geoff183,

no such bug, but a limitation with the precision, that is specially visible with some calculations.

The only way you can solve it, it's using the round() function to be sure that the result is right.

e.e. ROUND(A1-A2;2)

*** This bug has been marked as a duplicate of bug 67026 ***
Comment 2 geoff183 2015-07-05 00:33:02 UTC
Thank you for the quick reply. Interesting. I wonder why calculator programs do not have this problem?

I found this helpful:

https://www.youtube.com/watch?v=PZRI1IfStY0