GNOME Bugzilla – Bug 687269
odd roots of negative numbers
Last modified: 2012-11-02 19:08:31 UTC
In A1 add an odd integer > 1 In A2 add =(-8)^(1/A1) Gnumeric shows an error in A2 (which makes sense to me) The problem is interoperability with Excel. According to http://plugfest.opendocsociety.org/doku.php?id=scenarios:20121018:nroot_on_negative_radicand Excel2013 does not yield an error but recognizes that the formula essentially takes an odd root of a negative number.
That's sick. 1/odd is not finitely representable in base 2 unless odd==1. In fact, it will be represented as some p/q with even q. Now one could go looking for p'/q' approximating 1/odd, but with odd q'. There will be many such, but some will have even p' and some will have odd q'. So the sign of the result would be ill defined.
But maybe we need a three-argument power function to do x^(p/q).
As I said, it makes sense to me that Gnumeric shows an error. I think Excel's behaviour may only make sense if at parsing time this structure ()^(1/n) is translated into an nth root function, i.e. 1/n is never evaluated.
Yes a three-argument power function to do x^(p/q) would work for me.
=POWER(-8,1,3) now produces -2. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
I am not quite sure how this fixes the interoperability problem (I see it only as a first step.) If we have an excel file that uses In A1 3 In A2 =(-8)^(1/A1) then we don't invoke POWER so still get a #NUM... We still have to adjust the parsing on open of such a file (and possibly when entering such an expression)
It doesn't solve that. It only provides a fairly simple way to calculate odd roots. I am not sure we want to interoperate with that. (And with the new POWER in its current form we cannot -- the third argument must be an integer.)