Apache OpenOffice (AOO) Bugzilla – Issue 37129

Calc can't evaluate cube roots of a negative numbers or any other odd roots

Last modified: 2017-05-20 11:13:23 UTC

It looks like calc is unable to evaluate odd roots (a number raised to the power of 1/3,1/5,1/7,...etc). For instance if you type in as a formula -8^(1/3), calc returns #VALUE when the answer should be -2. It looks like any negative number you raise to a fractional exponent can't be evaluated. For even roots this should be expected since imaginary values would result, however odd roots should result in real values.

Hi, it's the same problem as described in Issue 24271. Therefore I close this one as double. Frank *** This issue has been marked as a duplicate of 24271 ***

closed double

Sorry, not a double. Frank

Hi Eike, please have a look. Frank

This should be changed, but it's not inportant enough for target "2.0".

Bug repeated in OOo1.1.3/Linux and 680m74 on WinXP

Repeated in 2.0.3 Linux

Why do you want to change it? It is dangerous to calculate like (-8)^(1/3)=-2. Look at this: (-8)^(1/3)=(-8)^(2/6)=((-8)^2))^(1/6)=64^(1/6)=2 If you use fractions in exponents and want to keep the rules for exponents, than you cannot allow negative base. And ^ and POWER calculate with exponents. There are other opinions, but then you are speaking of a cube root, which would be a new function in Calc.

*** Issue 74782 has been marked as a duplicate of this issue. ***

*** Issue 94487 has been marked as a duplicate of this issue. ***

The bug persists in OOo 3.0.1/WinXP. It leads to incompatibility with MS Excel and thus, to difficulties in migration. The general math rule says that "For odd values of n, every negative number has a real negative nth root" (http://en.wikipedia.org/wiki/Nth_root). And it's not correct to spaculate that "(-8)^(1/3)=(-8)^(2/6)=((-8)^2))^(1/6)=64^(1/6)=2". This speculation is a sort of sophism that masks the fact that there are more than one nth roots. When you make any transformations of powers you must take into account the possible loss of some roots or introduction of new roots. The correct result of "sqrt(x)" should be a multitude of two (possibly complex) numbers, not a single number. As we cannot return such a result in a spreadsheet we agree to see only positive answer, but it doesn't mean that we don't deserve to get correct negative real number as a cube root of a negative number. To be specific: x != sqrt(x^2), because, strictly speaking, sqrt(x^2) = {x, - x}. So (-8)^(1/3) = (-8)^(2/6) [only if you calculate 2/6 _before_ you calculate the exponent] != ((-8)^2))^(1/6), because here in the last case the base is raised to 2nd power and then the 6th root is taken, and the extra "2" brings new roots here (positive ones). As it can be seen in Issue 24271 (that was erroneously treated as duplicate to this one), the OOo team makes it's best to maintain compatibility with its main competitor. This approach has very strong base and is honored sometimes even if there's a mistake in th MS Office to let users migrate painlessly. But in this case you refuse to make changes that not only consistent with MS Excel, but also mathematically correct! [Workaround] for those who want to find the cube root: SIGN(X)*ABS(X)^(1/3)

Reset assigne to the default "issues@openoffice.apache.org".