Excel Math Bug

J

John Howard

In a recent multi, multi articled thread on this subject dealing with an
Excel formula =-5^2 returning +25, much discussion centred around precedence
of operations being responsible for the + result
Despite the many theories on this, an Excel formula =-5^3 returns -125.
In fact it would seem that any negative value raised to an EVEN power
retruns a positive result.
Whillst the same negative number raised to an ODD power returns a negative
result.

There are, of course simple workarounds like =0-5^2 and =-(5^2) to retrun
the apporpriate negative result.

However IMHO such inconsistency is still a Bug and is long overdue for a
fix.

Any other thoughts on this?

Regards

John Howard
 
J

jaf

Oh no. My calulator has the same bug!
Does Excel own Texas Instr. too?

John

johnf202 at hotmail.com


: In a recent multi, multi articled thread on this subject dealing with an
: Excel formula =-5^2 returning +25, much discussion centred around
precedence
: of operations being responsible for the + result
: Despite the many theories on this, an Excel formula =-5^3 returns -125.
: In fact it would seem that any negative value raised to an EVEN power
: retruns a positive result.
: Whillst the same negative number raised to an ODD power returns a negative
: result.
:
: There are, of course simple workarounds like =0-5^2 and =-(5^2) to retrun
: the apporpriate negative result.
:
: However IMHO such inconsistency is still a Bug and is long overdue for a
: fix.
:
: Any other thoughts on this?
:
: Regards
:
: John Howard
:
:
 
D

DevArrah

It's not an inconsistency... It's simply raising -5 to the 2nd power (-5
x -5 = 25) and -5 to the 3rd power (-5 x -5 x -5 = -125)

I'd suggest the what you really want is -(5^2) if you're aiming for -25
 
G

Guest

From Excel's help, the order of operations has negation before
exponentiation. Negation, not subtraction. So, -5^2 considers it as (-5)^2,
so I don't see any bug. Here's the text from help (xl 2003):
Operator Description
: (colon)
(single space)
, (comma)
Reference operators
– Negation (as in –1) <==============this comes before
% Percent
^ Exponentiation <=================this.
* and / Multiplication and division
+ and – Addition and subtraction
& Connects two strings of text (concatenation)
= < > <= >= <> Comparison
 
H

Harlan Grove

jaf said:
Oh no. My calulator has the same bug!
Does Excel own Texas Instr. too?

Sorry, this was covered in the referenced thread. If you have a single
display TI calculator, you have a [+/-] key, and -5^2 can be keyed either

5 [+/-] [x^y] 2 [=] returning +5

or

5 [x^y] 2 [=] [+/-] returning -5

but they key sequence

[+/-] 5

gives +5, not -5 since the calculator's accumulator register would start off
as zero, and the initial [+/-] key press wouldn't change [+]0 to -0. So
there's no correspondence between such TI calculators and Excel syntax.

If you're using a TI algebraic calculator, you're wrong. -5^2 returns -25,
while Excel returns +25.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top