After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790742 - PERMUTATIONA
PERMUTATIONA
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2017-11-23 00:22 UTC by Morten Welinder
Modified: 2017-11-23 02:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2017-11-23 00:22:14 UTC
PERMUTATIONA(-0.1,0) = ?

I.e., truncation before or after error check?

Also, why is the code casting to int?  That is asking for trouble with
values like PERMUTATION(2^32,0).
Comment 1 Andreas J. Guelzow 2017-11-23 00:40:11 UTC
The bug description does not seem to be related to ODF import/export. What am I missing.
Comment 2 Andreas J. Guelzow 2017-11-23 01:58:49 UTC
In Libreoffice PERMUTATIONA(-0.1,0) yields an error. 

In Gnumeric PERMUTATIONA(-0.1,0) yields 1.

According to ODF, since -0.1 is of the incorrect type (it should be an Integer) the appropriate implicit conversion function is applied. For conversion to Integer it says: "If the expected type is Integer for a function or operator, apply the “Conversion to Number” operation. 6.3.5 Then, if the result is a Number but not an integer, apply the specific conversion from Number to integer specified by that particular function/operator. If the function or operator does not specify any particular conversion operation, then the conversion from a non-integer Number into an integer is implementation-defined." Permutationa does not specify any particular function so Gnumeric's truncation is allowed. In general in ODF the conversion happens before the error check. It seems that LO converts the -0.1 to -1 and so gets an error.
Comment 3 Andreas J. Guelzow 2017-11-23 02:01:33 UTC
Note that in Excel 2013 PERMUTATIONA(-0.1,0) yields #NUM!
Comment 4 Morten Welinder 2017-11-23 02:15:50 UTC
ok, we can do that
Comment 5 Morten Welinder 2017-11-23 02:20:00 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.