ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Math Bug (https://www.excelbanter.com/excel-programming/307154-excel-math-bug.html)

John Howard

Excel Math Bug
 
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



jaf

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

John

johnf202 at hotmail.com


"John Howard" wrote in message
...
: 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
:
:



DevArrah[_2_]

Excel Math Bug
 
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


In article ,
"John Howard" wrote:

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


John Howard

Excel Math Bug
 

Good and valid point, DevArrah.

Many thanks

Regards

John Howard


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Bob Umlas, Excel MVP

Excel Math Bug
 
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


"John Howard" wrote:

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




Harlan Grove

Excel Math Bug
 
"jaf" wrote...
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.




All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com