HP Forums
BITXOR 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: BITXOR in RPN mode (/thread-9749.html)



BITXOR in RPN mode - frequencydrive - 12-21-2017 05:49 AM

I am an engineering student and just got this HP Prime. I am a long time user of RPN and have always used HP calculators. This Prime is taking a while to adjust to.

The calculator is set to RPN mode and I am in HOME

How do I use the command BITXOR(11,12) ? I keep getting "Error: Syntax Error." Even if I put 11 and 12 on the stack (see below) then type "BITXOR" nothing seems to happen. If I use BITXOR(11,12) in CAS mode then I get 7 which is the expected result. But I can't figure out how to make it work in RPN mode.

2: 11
1: 12
BITXOR

then I hit enter and i get:

2: 11
1: 12

That's it. BITXOR disappears and I just have 11 and 12 on the stack as before. What the heck?! Can someone try to use BITXOR in RPN mode and tell me what I need to do to make it work in RPN.


RE: BITXOR in RPN mode - wawa - 12-21-2017 05:35 PM

11 enter 12 bitxor(2)
in rpn, you have to specify the number of arguments to be taken from the stack


RE: BITXOR in RPN mode - Tim Wessman - 12-22-2017 12:09 AM

(12-21-2017 05:35 PM)wawa Wrote:  11 enter 12 bitxor(2)
in rpn, you have to specify the number of arguments to be taken from the stack

Specifically, it takes the minimum number of arguments automatically from the stack unless specified. This command can take a list of arguments as input allowing any number of XORs provided they were given in a list. Without a list, it can take up to 16 inputs directly.

Normally in RPN, the lowest number of arguments is the most common case and you don't have to do any specifying of argument count. This is a case where the most common use will be 2 args, but there was no way to support doing a list input without causing a slight inconvenience for RPN users.