Bug 80017 - EDITING: Rounding error in simple calculation - no division or multipliction used
Summary: EDITING: Rounding error in simple calculation - no division or multipliction ...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Spreadsheet (show other bugs)
Version: 4.2.0.4 release
Hardware: Other Windows (All)
: medium enhancement
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-14 09:10 UTC by Andrew
Modified: 2014-11-01 15:58 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
See cells J21 and J29 for error (18.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-06-14 09:10 UTC, Andrew
Details

Description Andrew 2014-06-14 09:10:08 UTC
Created attachment 101032 [details]
See cells J21 and J29 for error

Problem description: 
On a spreadsheet where all numbers entered have only 1 or 2 significant decimal digits and ALL operations are either subtraction or addition: the calculations sometimes introduce a rounding error.

The only other instruction used is a IF statement which should have no impact on the calculation per se.

 
Steps to reproduce:
1. See attached file in cells J21 and J29

              
Operating System: Windows 7
Version: 4.2.0.4 release
Comment 1 Luuk 2014-06-14 10:44:27 UTC
I copied your example, and opened it with Excel 2013
I got the same results.

Apparently, when the result of  this is 'wrong':
 -9425.03 - -9268.98 = -156.050000000001

But also:
 -9000.03 - -9270.98 = 270.949999999999

If you ROUND the result on 2 decimals, it will compare OK again... ;)

I think this is 'the way it works'-behaviour ?

Even Microsoft created a page about this:
http://support.microsoft.com/kb/214118
Comment 2 Andrew 2014-06-14 17:32:31 UTC
Luuk,

if there were divisions and multiplications I would agree with you ... actually I would never of brought up the issue.

HOWEVER - the spreadshhet contains ONLY subtraction and addition operations which should NEVER INTRODUCE rounding errors. If you look at the Microsoft example there is a multiplication.

I repeat (because this is the second time I bring up the subject): a spread sheet with only "+" and "-" operations SHOULD NEVER CONTAIN ROUNDING ERRORS.

Andrew
Comment 3 Luuk 2014-06-14 17:51:45 UTC
@Andrew: I agree with you that this error should not happen with only "+" and "-" oprations.

I also see that Excel 2013 is doing the same thing as LO 4.2.4.2 (which i'm looking at, see my second comment)
[ B.T.W.: This is NOT the same as claiming that Excel is GOOD, and that LO should behave the same way was Ecel does!!! ]

i will leave this at 'UNCONFIRMED', and wait for someone else to give his/her opinion on this, and mark this as 'CONFIRMED' or as 'IMPROVEMENT'...... ;-)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.