cancel
Showing results for
Did you mean:
Level 1
5 3 0 1
Message 1 of 4
5,657
Flag Post

Solved!

# Convert the result of a calculation into hexadecimal

HP Recommended
HP Prime

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.

Tags (1)
3 REPLIES 3
Level 9
971 954 119 186
Message 2 of 4
Flag Post
HP Recommended

Hi,

When working in HOME, go to HOME Settings and for Integers choose Hex.

Then on the command line:

R->B(Ans)

will give the last answer in Hex.

Best regards.

-Bart
_________________________________________________________
calculator enthusiast
Tags (1)
Level 1
5 3 0 1
Message 3 of 4
Flag Post
HP Recommended

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.

Level 9
971 954 119 186
Message 4 of 4
Flag Post
HP Recommended

Hi,

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.