Post Reply 
negative number raised to even power
05-07-2015, 06:29 PM
Post: #70
RE: negative number raised to even power
(05-07-2015 05:50 PM)Dave Britten Wrote:  Then I disagree with "standard mathematical notation". If -2^2=-4, then as far as I'm concened, 2.5^2=2.25 is just as valid.

I strongly agree with Dave.

-2 is a number preceded by the unary minus operator

and

0-2 is a subtraction.

In "the C programming language" 1977 by Kernighan/Ritchie/ Prentice Hall, Inc. the unary minus is already defined (operators, page 54 in the german edition) and has higher priority than multiplication/division and thus also higher than exponentiation, (but as exponentiation is not an operator but a function call in C this is inherent).

See also wikipedia "Operators", which differentiates also between unary minus and subtraction operator.

Imagine you store the number -2 in register 0 of an RPN calculator or in a variable y in C, then

Code:

RCL 0
2
y/x
is 4

or
Code:

result= pow(y,2);  // result is 4

Bernhard

That's one small step for a man - one giant leap for mankind.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
negative number raised to even power - DrD - 04-25-2015, 11:24 AM
RE: negative number raised to even power - PANAMATIK - 05-07-2015 06:29 PM



User(s) browsing this thread: 1 Guest(s)