06-03-2015, 05:22 PM
The programme takes an integer from the stack & returns a hexadecimal string of the same value.
eg For
88^88
otherwise known as
1301592834942972055182648307417315364538725075960067827915311484722452340966317215805106820959190833309704934346517741237438752456673499160125624414995891111204155079786496
the programme returns
# 0h
Well that's how it's displayed, as internally it's
HXS 00090 00000000000000000000000000000000000000000000000000000000000000000012963E64070DC5067631DBD7DFC91FF0C596AB955B4B773D6D0FE8343051A0A7DE54C9933E8510
& all the lowest hex values are zero. However if you apply ->H to the result you will see how the number is stored internally, so it is really there.
Given this result as input the programme returns the original integer.
eg For
88^88
otherwise known as
1301592834942972055182648307417315364538725075960067827915311484722452340966317215805106820959190833309704934346517741237438752456673499160125624414995891111204155079786496
the programme returns
# 0h
Well that's how it's displayed, as internally it's
HXS 00090 00000000000000000000000000000000000000000000000000000000000000000012963E64070DC5067631DBD7DFC91FF0C596AB955B4B773D6D0FE8343051A0A7DE54C9933E8510
& all the lowest hex values are zero. However if you apply ->H to the result you will see how the number is stored internally, so it is really there.
Given this result as input the programme returns the original integer.
Code:
::
CK1&Dispatch
# FF
::
FPTR2 ^DupQIsZero?
casedrop
HXS 00001 0
FPTR2 ^Z>ZH
# 2A4E
CHANGETYPE
;
BINT11
::
# 2614
CHANGETYPE
DO>STR
Z0_
SWAP
DUPLEN$
#1+_ONE_DO
DUPINDEX@
SUB$1#
BINT48
#-
FPTR2 ^#>Z
ROT
ZINT 16
FPTR2 ^RMULText
FPTR2 ^RADDext
SWAPLOOP
DROP
;
;