Error when computing -3^-2.1

  • Thread starter Thread starter CK
  • Start date Start date
C

CK

I received #NUM when trying to compute -3 ^ -2.1.

More generally, I found the same problem when raising the power of a
negative number by a negative non-integer value.

Has anyone else encountered the same problem? The version of Excel I am
using is Excel 2007 v12.0.63000.5000 SP1.
 
I tested this on Excel 2003 (on both worksheet and VBA) and received the same
error.

The only way you could get this to work is to use a parenthesis i.e.
-(3^-2.1).

I also tried putting -3 and -2.1 into seperate cells and this method fails
as well.
 
Read Excel's documentation on operator precidence (in Excel 2002, the Help
topic is "About calculation operators", subtopic "The order in which Excel
performs operations in formulas"). In Excel, the highest priority numeric
operator is unary minus, i.e. negation (as in -3). Thus in Excel,
-3 ^ -2.1
is interpreted as
(-3)^(-2.1)
which is a complex number, hence the #NUM error.

This is not the most widely used operator precedence, but it has
consistently been Excel's documented operator precedence since the first
release, and hence unlikely ever to change since changing it would
potentially break formulas in millions of existing workbooks.

Jerry
 
Back
Top