Post Reply 
Base conversion program.
07-05-2015, 06:34 PM (This post was last modified: 07-05-2015 11:51 PM by TechAlex.)
Post: #1
Base conversion program.
I am new to the HP Prime, I got mine about a month ago. One thing I do like about the HP Prime is that is very easy to program it. The HP Prime itself together with the Virtual HP Prime and the connectivity kit, in my opinion is the best combination. You are in control of this number eating machine.

I had for many years the 48SX, finally the "ON" key gave up.

Anyway, I read that the HP Prime sucks regarding base conversion, and I agree on that. I thought, a small program will take care of that, here it is based on SETBASE. (Page 544)

// HP Prime Base Conversion.
// Alex Rodriguez - 2015
EXPORT Base_Conversion()
BEGIN
LOCAL X,bin,oct,dec,hex;
INPUT(X, "Enter number to convert:");
bin:=SETBASE(X,1); // e.g. #0101110b
oct:=SETBASE(X,2); // e.g. #2345o
dec:=SETBASE(X,3); // For base 10, Enter number as usual.
hex:=SETBASE(X,4); // e.g. #456ABCDh, pay attention to the upper case.
PRINT();
PRINT("Here is the conversion regardless of what
base the Prime is set to:");
PRINT(" ");
PRINT("Binary number " +bin);
PRINT("Octal number " +oct);
PRINT("Decimal number" +dec);
PRINT("Hex number " +hex);
END;


Alex
Find all posts by this user
Quote this message in a reply
07-06-2015, 12:49 PM
Post: #2
RE: Base conversion program.
If you type a #number in HOME or CAS and invoke BASE again (Shift+[-]) you will get a little base conversion dialog.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
07-06-2015, 01:18 PM
Post: #3
RE: Base conversion program.
On the other hand, I'd love a conversion program to IEEE 754 floating point standard.

Marcelo
Find all posts by this user
Quote this message in a reply
07-06-2015, 10:57 PM
Post: #4
RE: Base conversion program.
(07-06-2015 12:49 PM)eried Wrote:  If you type a #number in HOME or CAS and invoke BASE again (Shift+[-]) you will get a little base conversion dialog.

Yes, eried, I am aware of that menu, to me its some kind of limited and archaic. Out of the box, the Prime is not the best for base conversion.

I'd Rather be a King in Hell than a Pauper in Paradise.
Find all posts by this user
Quote this message in a reply
07-06-2015, 10:58 PM
Post: #5
RE: Base conversion program.
(07-06-2015 01:18 PM)Marcelo Vanti Wrote:  On the other hand, I'd love a conversion program to IEEE 754 floating point standard.

That will be a nice late-night-weekend project.

I'd Rather be a King in Hell than a Pauper in Paradise.
Find all posts by this user
Quote this message in a reply
07-06-2015, 11:32 PM
Post: #6
RE: Base conversion program.
(07-06-2015 10:57 PM)TechAlex Wrote:  Yes, eried, I am aware of that menu, to me its some kind of limited and archaic. Out of the box, the Prime is not the best for base conversion.

Hello,

What do you consider to be limited/archaic? What do you want changed?

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
07-06-2015, 11:41 PM
Post: #7
RE: Base conversion program.
Please add Bit Shifting Functions to Prime such as:
Shift Left
Shift Right
Rotate Left
Rotate Right
Thank You
Colm
Find all posts by this user
Quote this message in a reply
07-07-2015, 12:00 AM (This post was last modified: 07-07-2015 12:12 AM by TechAlex.)
Post: #8
RE: Base conversion program.
(07-06-2015 11:32 PM)Tim Wessman Wrote:  
(07-06-2015 10:57 PM)TechAlex Wrote:  Yes, eried, I am aware of that menu, to me its some kind of limited and archaic. Out of the box, the Prime is not the best for base conversion.

Hello,

What do you consider to be limited/archaic? What do you want changed?



Dont get me wrong, the Prime is the best calculator out there. Compare to the Nspire and the Casio, the Prime is way more elegant the way the results are presented on the screen, the workmanship of the machine itself is superior compare to those two calculators, etc, etc.

When I said is limited and archaic, I refereed to that little base conversion menu.

Talking about changes, may be that menu can be improved.

I'd Rather be a King in Hell than a Pauper in Paradise.
Find all posts by this user
Quote this message in a reply
07-07-2015, 03:13 AM
Post: #9
RE: Base conversion program.
(07-06-2015 11:41 PM)douganc Wrote:  Please add Bit Shifting Functions to Prime such as:
Shift Left
Shift Right
Rotate Left
Rotate Right
Thank You
Colm

(07-07-2015 12:00 AM)TechAlex Wrote:  
(07-06-2015 11:32 PM)Tim Wessman Wrote:  Hello,

What do you consider to be limited/archaic? What do you want changed?



Dont get me wrong, the Prime is the best calculator out there. Compare to the Nspire and the Casio, the Prime is way more elegant the way the results are presented on the screen, the workmanship of the machine itself is superior compare to those two calculators, etc, etc.

When I said is limited and archaic, I refereed to that little base conversion menu.

Talking about changes, may be that menu can be improved.

There is a little reminder in the bottom of the app:
[Image: 07.07.2015-00.13.png]

you can drag with your fingers to do shift/bits operations, and change the base with +/-, etc

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
07-07-2015, 05:09 AM
Post: #10
RE: Base conversion program.
Hello,

Have you looked under the program editor to the cmds/Integer menu? there is quite a bit there too (pun intended)...

Cyrille
Find all posts by this user
Quote this message in a reply
07-07-2015, 07:51 AM
Post: #11
RE: Base conversion program.
I would prefer quick access, conversion and entry using the softkeys e.g.
Starting a big menu like it is at the moment is slowing down work. Especially when doing many conversions between bases.
I hope my wish got clear: anything like e.g. in the 42. A more productive solution.
Find all posts by this user
Quote this message in a reply
07-07-2015, 01:57 PM
Post: #12
RE: Base conversion program.
(07-07-2015 12:00 AM)TechAlex Wrote:  When I said is limited and archaic, I refereed to that little base conversion menu.

Talking about changes, may be that menu can be improved.

Yes, that is specifically what I'm asking for your feedback on. :-)

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)