Bug 129220 - I'm getting a repeatable error with the SUM() function
Summary: I'm getting a repeatable error with the SUM() function
Status: RESOLVED DUPLICATE of bug 123408
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.8.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-06 00:31 UTC by Andrew
Modified: 2019-12-06 03:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test case demonstrating the bug. (20.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-12-06 00:33 UTC, Andrew
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2019-12-06 00:31:17 UTC
Description:
The sum of 12 numbers using the SUM() function should be exactly 0.11, but instead comes out to be:  0.10999999999999900000
Doing an individual sum (A2+A3+...A13) gives the correct 0.11
Worse, the difference between these two gives:  0.00000000000000056899 instead of the expected 0.00000000000000100000

Details of the actual numbers used is below, in "steps to reproduce".

Detailed version & equipment info:
 - Calc reports:
Version: 6.2.8.2 (x64)
Build ID: f82ddfca21ebc1e222a662a32b25c0c9d20169ee
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
 - Windows reports:
Processor:  Intel Core i5-8265U @ 1.60GHz 1.80 GHz

Steps to Reproduce:
1. In cells A2:A13 I have the following exact numbers (NOT formulas):
-37.12
0
18.56
0
0

0
0
0
18.56

0.11
2. In cell A15 I have:
=IF(A16="","",SUM(A2:A13))
3. In cell A16 I have:
=A2+A3+A4+A5+A6+A7+A8+A9+A10+A11+A12+A13
4. In cell A17 I have:
=IF(A15=A16,"",A16-A15)

5. Now, cells A15-A17 show the following values:
A15:  0.10999999999999900000
A16:  0.11000000000000000000
A17:  0.00000000000000056899

I tried this in a new spreadsheet (cell A1 is empty).

Actual Results:
A15:  0.10999999999999900000
A16:  0.11000000000000000000
A17:  0.00000000000000056899


Expected Results:
A15:  0.11000000000000000000
A16:  0.11000000000000000000
A17:  0.00000000000000000000



Reproducible: Always


User Profile Reset: Yes



Additional Info:
 - LibreOffice Calc Help -> About reports:
Version: 6.2.8.2 (x64)
Build ID: f82ddfca21ebc1e222a662a32b25c0c9d20169ee
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
 - Windows 10 Settings -> About reports:
Processor:  Intel Core i5-8265U @ 1.60GHz 1.80 GHz
Windows 10 Home
Version 1903
OS Build 18362.476
Comment 1 Andrew 2019-12-06 00:33:56 UTC
Created attachment 156342 [details]
Test case demonstrating the bug.

Faulty values are in cells A15 and A17.
Comment 2 m_a_riosv 2019-12-06 03:10:08 UTC

*** This bug has been marked as a duplicate of bug 123408 ***