Bug 134549 - Strange/wrong sum in Calc
Summary: Strange/wrong sum in Calc
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-06 08:12 UTC by jacekwr
Modified: 2020-07-06 08:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jacekwr 2020-07-06 08:12:19 UTC
Description:
I have summed up some numbers (expenses and income from few operations and as a result I have rceived a number with a strange rest behind zero (I've double checked, all the summed up values were limited to 2 digits):
-500,00000000000000000000	
-500,00000000000000000000	
560,27000000000000000000	
2515,76000000000000000000	
700,00000000000000000000	
-27,31000000000000000000	
-700,00000000000000000000	
-2076,03000000000000000000	
-27,30999999999990000000	Sum

Strange....

Steps to Reproduce:
1. Write down following numbers in subsequent cells (vertical): 
-500
-500
560,27
2515,76
700
-27,31
-700
-2076,03
2. Create SUM function below, or simply add-up (both give same results)
3. Increase column width and increase number of digits.
4. Have fun. ;)
5. Tip: Removing ANY number from the list makes sum correct. But that's not a solution.

Actual Results:
-27,3099999999999

Expected Results:
-27,31


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Wersja: 6.2.5.2 (x64)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
Wątki CPU: 8; OS:Windows 10.0; UI render:domyślny; VCL: win; 
Ustawienia regionalne: pl-PL (pl_PL); Język interfejsu: pl-PL
Calc: CL
Comment 1 Julien Nabet 2020-07-06 08:33:07 UTC
On pc Debian x86-64 with LO 6.4.5, I don't reproduce this.

Could you give a try to last stable LO version 6.4.5?

If you still reproduce this, could you attach an example file?
Comment 2 Eike Rathke 2020-07-06 08:50:39 UTC
Whatever.. just usual binary floating point inaccuracy, you'll get the same in Gnumeric and Google Sheets.
See https://erack.de/bookmarks/D.html#010203