Post Reply 
- number ^ power issue? HP Prime
05-28-2014, 04:58 PM
Post: #1
- number ^ power issue? HP Prime
Hi,

I did not notice following with prior HP Prime firmware:

-3^2 yields -9 but
(-3)^2 yields +9

I hope I am missing something here, otherwise this is a problem.
Find all posts by this user
Quote this message in a reply
05-28-2014, 05:09 PM
Post: #2
RE: - number ^ power issue? HP Prime
(05-28-2014 04:58 PM)CR Haeger Wrote:  -3^2 yields -9 but ...

I think this must due to precedence of operators. The Prime (now) thinks that unary negation is lower precedence than exponentiation.

By the way, when I do this in python I get the same thing:


>>> -3**2
-9
>>>
Visit this user's website Find all posts by this user
Quote this message in a reply
05-28-2014, 05:09 PM
Post: #3
RE: - number ^ power issue? HP Prime
Both results appear to be correct.

1. how would you evaluate 0-3^2?

2. the square of a negative number is positive

I hope *I* have not missed anything here.
Find all posts by this user
Quote this message in a reply
05-28-2014, 05:15 PM (This post was last modified: 05-28-2014 05:17 PM by Thomas Radtke.)
Post: #4
RE: - number ^ power issue? HP Prime
(05-28-2014 05:09 PM)Jonathan Cameron Wrote:  I think this must due to precedence of operators. The Prime (now) thinks that unary negation is lower precedence than exponentiation.
Please have a look here:

http://en.wikipedia.org/wiki/Order_of_operations

In written or printed mathematics, the expression −3^2 is interpreted to mean −(3^2) = −9,[3] [...]

[3] Allen R. Angel, Elementary Algebra for College Students 8/E; Chapter 1, Section 9, Objective 3
Find all posts by this user
Quote this message in a reply
05-28-2014, 05:25 PM
Post: #5
RE: - number ^ power issue? HP Prime
48 and 50 do the same in an algebraic obj...

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-28-2014, 05:29 PM
Post: #6
RE: - number ^ power issue? HP Prime
http://www.wolframalpha.com/input/?i=-3^2

-ditto-
Find all posts by this user
Quote this message in a reply
05-28-2014, 06:01 PM
Post: #7
RE: - number ^ power issue? HP Prime
(05-28-2014 05:29 PM)DrD Wrote:  http://www.wolframalpha.com/input/?i=-3^2

-ditto-
Same on Google, same on Bing.
Find all posts by this user
Quote this message in a reply
05-28-2014, 06:11 PM
Post: #8
RE: - number ^ power issue? HP Prime
Thanks all - yes the Prime (and other calculators) are doing this correctly.

My error.
Find all posts by this user
Quote this message in a reply
05-28-2014, 07:05 PM
Post: #9
RE: - number ^ power issue? HP Prime
(05-28-2014 06:11 PM)CR Haeger Wrote:  Thanks all - yes the Prime (and other calculators) are doing this correctly.

Woohoo! I get to win for once! Big Grin

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-28-2014, 08:17 PM
Post: #10
RE: - number ^ power issue? HP Prime
(05-28-2014 07:05 PM)Tim Wessman Wrote:  
(05-28-2014 06:11 PM)CR Haeger Wrote:  Thanks all - yes the Prime (and other calculators) are doing this correctly.

Woohoo! I get to win for once! Big Grin

Well don't let it go to your headSmile

Seriously, Tim. Thank you for all you do and for communicating information with us. Without you and Cyrille I suspect there would be no new RPN calculators from HP and certainly no RPN mode in the Prime.

Steve Simpkin
Visit this user's website Find all posts by this user
Quote this message in a reply
05-28-2014, 08:18 PM
Post: #11
RE: - number ^ power issue? HP Prime
(05-28-2014 07:05 PM)Tim Wessman Wrote:  
(05-28-2014 06:11 PM)CR Haeger Wrote:  Thanks all - yes the Prime (and other calculators) are doing this correctly.

Woohoo! I get to win for once! Big Grin
Ha ha ha thumbs up Tim
Find all posts by this user
Quote this message in a reply
05-28-2014, 10:37 PM
Post: #12
RE: - number ^ power issue? HP Prime
(05-28-2014 07:05 PM)Tim Wessman Wrote:  
(05-28-2014 06:11 PM)CR Haeger Wrote:  Thanks all - yes the Prime (and other calculators) are doing this correctly.

Woohoo! I get to win for once! Big Grin

Don't worry, there are a lot more things the Prime can do correctly that I still wouldn't recognize as being correct. Blame my out of date firmware...
Find all posts by this user
Quote this message in a reply
Post Reply 




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