HP Forums
RPL: Binary to "long ints"? - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: RPL: Binary to "long ints"? (/thread-153621.html)



RPL: Binary to "long ints"? - Mark Edmonds - 07-28-2009

I have to admit that I am slightly confused by the exact/approx modes of machines from the 49G onwards. I also find it slightly frustrating in that porting programs over that use display formatting get messed up by the extra decimal point.

Anyway, here is the question.

With Exact mode set ON, I don't understand why doing this doesn't result in an exact mode integer that preserves all digits:

\<< TICKS B\->R \>>

The only way round this I've found so far is to convert the result from TICKS into a string, edit out the # and base indicator and then use OBJ-\> to get it to the correct integer.

It would be a lot neater and more efficient if this conversion could be done with a single command.

Does anyone know how this would be done please?

Thanks!

Mark


Re: RPL: Binary to "long ints"? - Tim Wessman - 07-28-2009

It would help a little to know what you are trying to do, but I don't think there is any way to change a hex value directly into an integer. It has always converted into a real number AFAIK.

As to the rest, use R->I commands in your display program and everything will work fine.

TW


Re: RPL: Binary to "long ints"? - Mark Edmonds - 07-28-2009

Thanks for the tip Tim! I didn't even know about the R->I command and I was wondering how that conversion was done.

Mark