GNOME Bugzilla – Bug 790742
PERMUTATIONA
Last modified: 2017-11-23 02:20:00 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).
The bug description does not seem to be related to ODF import/export. What am I missing.
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.
Note that in Excel 2013 PERMUTATIONA(-0.1,0) yields #NUM!
ok, we can do that
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.