(49G) Z->B & B->Z full Accuracy
|
05-31-2015, 02:12 PM
(This post was last modified: 06-15-2017 01:42 PM by Gene.)
Post: #1
|
|||
|
|||
(49G) Z->B & B->Z full Accuracy
The 49G converts zints to hexadecimal strings by R->B, first transforming the zint to a real & thereby loosing significant digits.
This programme does Z->B & B->Z to full accuracy. eg For input 9898989898989898979 the programme returns # 9898989898989898979d & applying the programme again returns the original zint. Code: :: |
|||
06-02-2015, 05:22 AM
Post: #2
|
|||
|
|||
RE: HP 49G: Z->B & B->Z full Accuracy
FWIW, I've been using the following User RPL programs for many years. They seem to work ok for inputs up to 2^64-1.
Z->B << "#" SWAP + "d" + OBJ-> >> B->Z << PUSH DEC ->STR 3 OVER SIZE 1 - SUB OBJ-> POP >> <0|ɸ|0> -Joe- |
|||
06-02-2015, 08:11 AM
Post: #3
|
|||
|
|||
RE: HP 49G: Z->B & B->Z full Accuracy
Great work, thank you, Joe.
Have you published these programmes previously? You have saved me 100 Bytes of memory. |
|||
06-02-2015, 09:23 PM
Post: #4
|
|||
|
|||
RE: HP 49G: Z->B & B->Z full Accuracy
(06-02-2015 08:11 AM)Gerald H Wrote: Great work, thank you, Joe. I don't think so, but the probability of my having published them and forgotten is higher than the probability of my never having published them and remembering that fact correctly. <0|ɸ|0> -Joe- |
|||
06-03-2015, 01:42 AM
Post: #5
|
|||
|
|||
RE: HP 49G: Z->B & B->Z full Accuracy
(06-02-2015 09:23 PM)Joe Horn Wrote:(06-02-2015 08:11 AM)Gerald H Wrote: Great work, thank you, Joe. As I get older, I find this concept applies more and more often; thanks for stating it so succinctly Joseph. Have you thought of naming this little gem, something akin to "Horn's rule"? Oh, and the programs are truly short and sweet too. Thanks. --Bob Prosperi |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)