Post Reply 
Negative numbers with exponents in RPN
01-28-2021, 12:08 AM (This post was last modified: 01-28-2021 12:19 AM by ijabbott.)
Post: #6
RE: Negative numbers with exponents in RPN
(01-27-2021 07:59 PM)john gustaf stebbins Wrote:  Further testing this on the Prime I calculated 5-7 (using textbook mode). Then I copied the result of this calculation to the command line and applied x^2. The result was -4. So the prime is applying the square inside the negative symbol on a result that is clearly a negative number.

The Prime is not the only calculator I tried that made the same error.

So you selected the result -2, copied it into the clip buffer, changed to RPN entry mode, pasted the -2 into the command line, pressed the x^2 key and got the answer -4? Because I just did that and got the answer 4 as expected.

EDIT: Perhaps you did the pasting and squaring in textbook or algebraic mode? In those modes, -2 x^2 will produce the result -4 because the x^2 operation has higher precedence than the negative sign. One of the advantages of RPN is that there are no operator precedence rules.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Negative numbers with exponents in RPN - ijabbott - 01-28-2021 12:08 AM



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