HP Forums
Swap X Y in RPN Mode - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Swap X Y in RPN Mode (/thread-19597.html)



Swap X Y in RPN Mode - Mgerbasio - 02-25-2023 08:39 PM

I dusted off the HP Prime and updated it to the latest firmware on the HP site. I've been using HP calculators since the 41C and they've all had a dedicated button to swap X Y registers. It annoying without it using RPN at least for me. Probably why it's been been sitting in a desk drawer.
Is there another solution other than hitting enter to load the number on the stack and use roll down? Can I assign a program to a key I down use anymore? The custom labels for the keys on the 41C would be handy for this Smile

Thanks.


RE: Swap X Y in RPN Mode - Joe Horn - 02-26-2023 03:24 AM

Prime has a dedicated X<>Y key in RPN mode too. It's the comma key, between the parentheses key and the Enter key. See that tiny symbol next to the comma? It's the SWAP symbol, in the Prime universe.


RE: Swap X Y in RPN Mode - KeithB - 02-27-2023 01:33 PM

Just for the record, here is an image of the relevant section of the manual, which includes a section on RPN:
[attachment=11808]


RE: Swap X Y in RPN Mode - KeithB - 02-27-2023 04:09 PM

One nit: On the Prime you *can't* swap X and Y since there are no X and Y registers. Like forth, you have an arbitrary number of stack levels. On the Prime they are numbered. So you swap levels 1 and 2, not X and Y.


RE: Swap X Y in RPN Mode - Joe Horn - 02-27-2023 09:14 PM

(02-27-2023 04:09 PM)KeithB Wrote:  One nit: On the Prime you *can't* swap X and Y since there are no X and Y registers. Like forth, you have an arbitrary number of stack levels. On the Prime they are numbered. So you swap levels 1 and 2, not X and Y.

Aha, quite right! But what should we call it? "1<>2" looks goofy. Maybe just "SWAP" like in RPL? (Related note: Prime's RPN is NOT the same as RPL. Prime's RPN stack is limited to 128 objects, maximum.) Prime's keyboard calls it Unicode 292D, "", but that's not easy to type on some systems, and I personally find it annoyingly unreadable.


RE: Swap X Y in RPN Mode - Peet - 02-27-2023 09:30 PM

(02-27-2023 04:09 PM)KeithB Wrote:  So you swap levels 1 and 2, not X and Y.

Even if the stack levels are numbered, they can still represent "x" and "y".
On RPL Calculators the key x^2 squares the value of Stack Level 1 (same with root) and y^x works the same on RPL (Level 2 ^ Level 1) and classic RPN (y^x).

Only the prime messes everything up. The key is labeld x^y but don't work like x^y (on the HP-35). It works instead like y^x on all other RPL & RPN Calculators.


RE: Swap X Y in RPN Mode - polbit - 02-27-2023 10:20 PM

Using Prime in RPN mode is an exercise in frustration to be honest...


RE: Swap X Y in RPN Mode - PrimeG2_hp48sx - 03-01-2023 02:57 PM

(02-25-2023 08:39 PM)Mgerbasio Wrote:  I dusted off the HP Prime and updated it to the latest firmware on the HP site. I've been using HP calculators since the 41C and they've all had a dedicated button to swap X Y registers. It annoying without it using RPN at least for me. Probably why it's been been sitting in a desk drawer.
Is there another solution other than hitting enter to load the number on the stack and use roll down? Can I assign a program to a key I down use anymore? The custom labels for the keys on the 41C would be handy for this Smile

Thanks.

Sure. The ","-key works as swap. If you look really closely, you will see a tine Swap symbol on th key.