Bug 77969 - EDITING: Changed functionality of min/max of empty array/unexpected value returned
Summary: EDITING: Changed functionality of min/max of empty array/unexpected value ret...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.3.3 release
Hardware: Other Linux (All)
: medium normal
Assignee: Kohei Yoshida
URL:
Whiteboard: BSA target:4.3.0 target:4.2.5
Keywords:
: 77968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-26 13:52 UTC by Teraslilja
Modified: 2014-04-28 23:05 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Demonstrates different min/max equations (39.51 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-04-26 13:52 UTC, Teraslilja
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Teraslilja 2014-04-26 13:52:28 UTC
Created attachment 98035 [details]
Demonstrates different min/max equations

Normally, expected value of min/max of empty array is zero.

With 4.2.3.3, min/max of empty *array*, is +-inf, not zero as expected and previous versions has returned.

for comparison: Gnumeric (1.12.9) return zeros.

              
Operating System: Ubuntu
Version: 4.2.3.3 release
Comment 1 Julien Nabet 2014-04-26 15:31:57 UTC
*** Bug 77968 has been marked as a duplicate of this bug. ***
Comment 2 m_a_riosv 2014-04-26 17:33:08 UTC
Hi Teraslilja, thanks for reporting.

Reproducible with:
Win7x64Ultimate
Version: 4.2.0.4 Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Versión: 4.2.3.3 Id. de compilación: 882f8a0a489bc99a9e60c7905a60226254cb6ff0
Version: 4.3.0.0.alpha1+ Build ID: b08754f3358992387ea0eec7957745f4667ea7eb
  TinderBox: Win-x86@39, Branch:master, Time: 2014-04-26_00:32:11


Last working.
Version: 4.1.6.1 Build ID: a59ce81388f477fc89db57f0c27f222f31884eb

The problem seems in relation with the third parameter for IF() function, not present in the formulas, adding it works as expected.
Comment 3 Teraslilja 2014-04-26 17:56:57 UTC
If using array equation like {=MIN(IF(B3:B11="b",C3:C11,0))} in example attached, it will return 0 and not 1, as expected/wanted. Adding a third parameter for IF() is not a "fix" in this case.
Comment 4 m_a_riosv 2014-04-26 19:00:17 UTC
Because MIN is MIN, it is not a formula error, you need to set up instead 0 a value higher enough to get the correct result. Even the bug is solved the same problem will be there.

{=MIN(IF($B$3:$B$11="b",$C$3:$C$11,""))}

and you need develop more the formula to avoid issues with for values like "d" not in the list, what return the bug values.
Comment 5 Kohei Yoshida 2014-04-28 16:55:31 UTC
I'll take this.
Comment 6 Commit Notification 2014-04-28 17:46:30 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a4a5f67008a931508a9d963f6b95db9cb9d45aef

fdo#77969: Write test for this corner case.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2014-04-28 17:46:43 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=453ea919e70fa9832f11e3ef042bb80cd86892cc

fdo#77969: Return 0 in case of matrix consisting of all empty elements.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Kohei Yoshida 2014-04-28 17:46:57 UTC
4.2 backport: https://gerrit.libreoffice.org/9189
Comment 9 Commit Notification 2014-04-28 22:58:50 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bfc8a79c957dd65dc7e42c47c4fc6de61443fa29&h=libreoffice-4-2

fdo#77969: Return 0 in case of matrix consisting of all empty elements.


It will be available in LibreOffice 4.2.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Kohei Yoshida 2014-04-28 23:05:32 UTC
Fixed.