HP Forums
I'm having some problems with integer definitions... - 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: I'm having some problems with integer definitions... (/thread-9494.html)



I'm having some problems with integer definitions... - webmasterpdx - 11-15-2017 07:43 AM

I'm using the Beta, but I suspect these issues are not release based.

The rules for specifying values in different bases are not consistent.

e.g. To specify a number in hex, octal, decimal and binary are #0h, #0o, #0d and #0b respectively.
From the command line, the lower case letters are used, but in programs, you need to use Upper case letters to define the base.

Also, I can't seem to specify the number of bits. I thought it was #0d32, but from the command line this is getting converted to #0d*32 and in programs it's getting converted to the hex number d32 (I think hex is in my settings somewhere)....

So, how do I specify the number of bits. I did see in the user manual #0:b in one spot, but I tried the colon and it didn't seem to work (from the command line).

help???
Thx


RE: I'm having some problems with integer definitions... - webmasterpdx - 11-15-2017 07:54 AM

OK, I've figured out the upper/lower case issues.
The base is always in lower case (in programs and in command line). I was confused with that because the # went to my default base of hex, which needed an upper case D to define the integer.

So, values are always using upper case letters in hex.

e.g. #19d is 19 decimal, but #19Dh is 19D hex.

However, I still don't know how to specify the number of bits in the integer. I know I can use SETBITS, but I need to know how to express it in the integer value, like #19h32.


RE: I'm having some problems with integer definitions... - Stevetuc - 11-15-2017 08:04 AM

#19:16d 19 decimal 16bits
#19D:16h 19D hex 16bits


RE: I'm having some problems with integer definitions... - webmasterpdx - 11-15-2017 08:40 AM

That works! Also, you cannot use #19D:h. You must put a number before the base if using the :

Thank you!
-Donald


RE: I'm having some problems with integer definitions... - Carlos295pz - 11-16-2017 03:12 AM

It is in Spanish but can serve: https://carlos-icg.blogspot.pe/2017/09/entero-tipo-hp-prime.html