Create an account on the HP Community to personalize your profile and ask a question
07-11-2017 11:03 AM
Suppose you´re doing some calculations, using the decimal number format, and come to a result, As an example, let´s say you calculated 10*10 and got the result 100.
Now you want that result to be expressed in hexadedimal (or any other base, like binary or octal). How caon you do that in HP Prime? Using the above example, how can you get the result 100 expressed in hexadecimal base?
Is ther any key or sequence of keys that displays a number converted to other bases?
This question is not about programming. I want to convert numbers while I´m doing caldulations, and not running a program.
Solved! Go to Solution.
07-11-2017 11:50 AM
When working in HOME, go to HOME Settings and for Integers choose Hex.
Then on the command line:
will give the last answer in Hex.
07-11-2017 01:24 PM
Thanks for the answer, BartdB.
That actually does the job. However, I was expecting HP Prime provided a simpler way to do it. For example, keying shift Base could open the integer editor with the last answer. I don´t know whether it is a bug or works as designed, but integer editor is opened iwth last answer only if it´s expressed in hex.
For example, if I do the calculations and get the answer in decimal, and then press shft Base twice, the integer editor is opened wiht value 0.
If I do the calculations and get the answer in decimal, then use the R->B as you mentioned, I get the result expressed in hexadecimal (something like #64d). If now I press shift Base, the integer editor is opened with the value #64d and the respective representation in other bases (decimal, octal and binary).
I would be satisfied if I could open the integer editor with the last answer, even if it is expressed in decimal.
Anyway, even if it isn´t the answer I was expecting, it works.
07-11-2017 01:58 PM
As far as I can tell, the Edit Integer only opens if the last answer (or highlighted history item) starts with the Base marker, #.
If the last answer (or highlighted history item) does not start with ith the Base marker, Shift Base will merely put a base marker in the command line.
You can enter a value in any base irrespective of the base setting, by starting the number with # and ending with the base type (d for decimal, o for octal, h for hex and b for binary).
So editing your answer to be e.g. #100d will allow Shift Base to open the Edit Integer and convert to another base.
Otherwise R->B will convert to the defualt base and B->R will convert from any base.
For more info see chapter 29 of the manual.