HP Prime: Edit integer in RPN mode  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: HP Prime: Edit integer in RPN mode (/thread252437.html) 
HP Prime: Edit integer in RPN mode  plivesey  10072013 My apologies if this has been asked and answered before, I've had a search but couldn't find anything. I've been playing with the Prime emulator, prior to buying one, and have a question concerning integer arithmetic. I spend far too much of my time at work bit twiddling and as I can't afford an HP16C I thought the prime might be helpful in this regard. In textbook or algebraic mode I can press shiftminus to bring up the 'Edit Integer' dialog and I can view the binary representation of a number, shift it about and change its size. However in RPN mode all shiftminus does is bring up the # symbol. Am I missing something or is this desired behaviour? Any advice would be much appreciated.
Paul.
Re: HP Prime: Edit integer in RPN mode  Joe Horn  10072013 > Am I missing something or is this desired behaviour?
Unfortunately the Edit Integer environment is not available in RPN mode. (Not yet, anyhow).
Re: HP Prime: Edit integer in RPN mode  plivesey  10072013 That's a shame as I find it really useful but hate having to shift out of RPN mode to use it.
Paul
Re: HP Prime: Edit integer in RPN mode  Helge Gabert  10072013 You might find it easier (if you like the Prime) to just ditch RPN   that way, everything integrates nicely, from Home view to CAS view to programming  albeit in algebraic mode. I like RPN myself, and use it exclusively on the 50G, but on this machine, I now prefer algebraic mode.
Re: HP Prime: Edit integer in RPN mode  kris223  10072013 Even if one were to ditch RPN, bit twiddling on this calculator is cumbersome. The edit integer mode isn't good for rapidly seeing how many 1's are in decimal numbers one after the other for example. Or continually checking hex or binary numbers to see if your answers are correct or any other thing of the sort in my opinion. To ditch RPN would be to ditch the original reason I like HP calculators though. RPN does feel like an afterthought on this thing.
Re: HP Prime: Edit integer in RPN mode  plivesey  10082013 I struggle to use a nonRPN calculator these days, so ditching it isn't really an option. Currently have a 15C, 49G and WP 34S on my desk. Each used for specific tasks. Was looking for the one calculator to rule them all and hoped the prime was it.
Paul
Re: HP Prime: Edit integer in RPN mode  mjcohen  10092013 There are good emulators for the 16C (and many other HP calculators) available for iOS (iPhone and iTab) and Android phones and tablets.
Re: HP Prime: Edit integer in RPN mode  kris223  10162013 Please try this:
KEY K_SIN() For anyone reading this that may need more explicit directions:
Put the program in the calc via SHIFT>Program and it will assign a user program to the SIN key. 1)Enter the numbers with the default base: ALPHA>#>myNumberThis will change the "#"'s to the default base in much the same manner as the HP48G did. Hope this helps.
Edited: 16 Oct 2013, 5:20 p.m.
Re: HP Prime: Edit integer in RPN mode  Jonathan Cameron  10172013 Thanks Kris, I had trouble getting this to work until I figured out that it only works when you have the EditInteger dialog up. I associated it with the [] key since it is the one that has the SHIFTed value of Base. EDIT: I found it odd that the minus key [] did not do anything (apparently) when the EditInteger dialog was not up. If you pressed [User] then [] elsewhere it just performed the normal Minus operation. But in the EditInteger dialog it worked perfectly! Jonathan
Edited: 17 Oct 2013, 12:18 a.m.
Re: HP Prime: Edit integer in RPN mode  kris223  10172013 Thanks, This will work in RPN mode right off the stack. That's how I'm using it. As a random example, say I need to know the binary values of the follow min terms so I can do a Kmap: f(A,B,C,D)= sum of min terms(3,9,11,13) I'll use the program (SIN key in my case) to go into decimal mode:
Note: ">" means next step ... or then Now the calculator has the decimal base as the default.
I enter my min terms: ALPHA>#>3>Enter
Now we convert them all to binary: 1)Shift>User>SIN
The stack will go from all "#" tagged numbers in decimal: #3d
To all in binary: #11b Now I can plug A'B'CD + AB'C'D + AB'CD + ABC'D into my Kmap and find the result of B'CD + AC'D as the simplest gate configuration to implement the circuit. This helps me out a lot with homework and tests as I can quickly swap to/from any base with a large or small number of values to convert. Hope this helps and please let me know if I'm not being clear on something. This is very similar to the way I would operate on the HP 48G. The main difference is the HP 48G would do this type of operation in a smaller number of key strokes. I hope they implement this in a Prime update as going to the Settings Menu is very cumbersome in my opinion and the Edit Integer screen makes mass conversions painful. My program still uses too many key strokes, but I'll take it over the alternatives.
Edited: 17 Oct 2013, 2:15 p.m.
Re: HP Prime: Edit integer in RPN mode  Jonathan Cameron  10172013 Kris, Okay now my "base" key does something in RPN mode. It eats the number and updates the display mode. But I do not get a popup dialog asking which base to use. Are you assuming something is in B? If so, what? And what does the Base:=B1; statement do? Thanks
Jonathan
Re: HP Prime: Edit integer in RPN mode  kris223  10172013 The Base:=B1 is setting the calcs base variable. The "choose" dialog sets the variable B to the number chosen. It's indexed at one and increments from there based on how many choices there are. So we have four choices so it will return a 1 if Bin is selected, 2 if Oct is selected and so on. The "Base" variable goes from 0 to 3 so we subtract one from the variable B to get the right base. Hope that made sense ... please see the help dialog for the Base variable.
Now, I'm guessing you are invoking the program without finishing entering the number. Enter the numbers on the stack and then call the program. I hope that's it and let me know how it goes. There shouldn't be any eating of the number :) Edited: 17 Oct 2013, 3:22 p.m.
Re: HP Prime: Edit integer in RPN mode  Jonathan Cameron  10172013 Thanks for the explanation. Makes sense. We should probably convert B to a LOCAL to avoid overwriting the user B variable. It was "eating" the number because it was actually performing subtraction (I have it set to the Minus key). So it was not doing the userkey function at all. When I put the numbers on the stack, press [User] then [Minus] I do not get the K_Minus function executing at all. I did create it using the "Create User Key", etc. So I think that is is in there correctly.
Here is what I have in my USERKEYS program: KEY K_Minus()It looks the same to me as what you listed earlier. Could you doublecheck with your calculator to see if I've got a typo in the code? Yes, I'm running it in RPN mode.
Jonathan Edited: 17 Oct 2013, 3:32 p.m.
Re: HP Prime: Edit integer in RPN mode  kris223  10172013 Your advice on changing the variable to local is a good one. I think you should try assigning it to a different key than minus and see what happens. I was originally trying to use the "a b/c" key but it didn't want to play so I went with the "SIN" key.
Edited: 17 Oct 2013, 11:54 p.m.
Re: HP Prime: Edit integer in RPN mode  Jonathan Cameron  10182013 Okay! I got it working! I had to assign it to the [Sin] key as you suggested. I also used a LOCAL 'nb' instead of B and it worked great in RPN mode (after I added the missing "Bin" choice). Thanks for your help.
Not sure why the [Minus] key did not work...
Re: HP Prime: Edit integer in RPN mode  kris223  10182013 Great!
