View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel 2003 SP2 computes the power of a negative number wrong.

Despite what you believe, Excel has defined the order of precedence for evaluation of its formulas. This has not changed. (also note that negation and subtraction fall in to different areas).

Here is the help from xl2000 for example:

The order in which Microsoft Excel performs operations in formulas
If you combine several operators in a single formula, Microsoft Excel performs the operations in the order shown in the following table. If a formula contains operators with the same precedence €” for example, if a formula contains both a multiplication and division operator €” Excel evaluates the operators from left to right. To change the order of evaluation, enclose the part of the formula to be calculated first in parentheses. For more information about calculation operators,

Operator Description
: (colon)
(single space)

, (comma)
Reference operators
€“ Negation (as in €“1)
% Percent
^ Exponentiation
* and / Multiplication and division
+ and €“ Addition and subtraction
& Connects two strings of text (concatenation)
= < <= = < Comparison


--
Regards,
Tom Ogilvy

"Giovanni Ciriani" wrote in message ...
The negations belongs to the -4. The - in front of A1 should be trated as a
subtraction sign. Exponentiation takes precedence over subtraction.

To prove this point, please enter another formula: =1-A1^4 and for a value
of A1=-4 you obtain -255. Why should the minus in front of A1 be treated with
different precedences depending whether or not there is a 1 in front of it?

Every program that manipulates symbolic math gives precedence to the
exponentiation and then put the minus in front of it. My HP pocket calculator
does that too, and math students are taught the same way in school
(elementary through post-graduate). Previous versions of Excel behaved the
way I was expecting. This versionnis behaving incorrectly and I seriously
believe it to be a misinterpretation of symbolic math.

"Mike Middleton" wrote:

Giovanni Ciriani -

See Excel Help "About calculation operators."

Negation is performed before exponentiation.

- Mike
http://www.mikemiddleton.com


"Giovanni Ciriani" <Giovanni wrote in
message ...
A1 contains -4.
B1 contains the expression -A1^4
The result is supposed to be -256, but instead it is 256.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow
this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...et.f unctions