Bug 40528 - Sort by formula math calculations
Summary: Sort by formula math calculations
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2011-08-31 12:59 UTC by matt
Modified: 2023-04-17 19:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
bug example (8.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-08-31 12:59 UTC, matt
Details
40528_bug_with_sort_test01 (18.28 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-09-12 21:22 UTC, b.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matt 2011-08-31 12:59:13 UTC
Created attachment 50775 [details]
bug example

A simple spreadsheet is attached that contains some examples of the bug. Basically the math being done for some values throws a .000000000000001 on to the value. This causes sorting by this column to be bugged.
the first column is a value the second column is subtracted from it. the third column is the formula and the fourth column is the value my version is showing me in case you do not see it.
Comment 1 matt 2011-09-01 07:49:59 UTC
I have confirmed this with 3.3.3 and 3.3.1 as well
Comment 2 Björn Michaelsen 2011-12-23 12:34:53 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 Florian Reisinger 2012-08-14 14:02:09 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 4 Florian Reisinger 2012-08-14 14:03:10 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:07:44 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:09:50 UTC Comment hidden (obsolete)
Comment 7 b. 2020-09-12 21:22:52 UTC
Created attachment 165435 [details]
40528_bug_with_sort_test01

reopening, still an issue, could have easily been checked as demo sheet attached, sum_s function in attachement shows better results are possible, 

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 0e8696bc2784364cfbefd7fa55da733e350c56cd
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL
Comment 8 QA Administrators 2022-09-13 03:33:28 UTC Comment hidden (obsolete)
Comment 9 Robert Lacroix 2023-04-17 19:00:25 UTC
Note what the description said.

"Basically the math being done for some values throws a .000000000000001 on to the value."

This is a fundamental limitation in representing some numbers inside all computers, called Round-off Error, which can not be fixed but can be worked around.

The round-off error appears as an extra amount in your calculated value because you subtracted an inexactly represented number from a number which is represented exactly.

To work around the problem this causes in sorting, you must round the calculated value to an acceptable precision using the ROUND(value, digits) spreadsheet function in the formula of the column you are sorting.