headyprimes <n...@valid.tld> writes:
> Reading the man page did not really clarify for me what the PAP
> sequence at the end is doing, I gather the 'P' are pops if I read it
> right, but I did not find what the capital 'A' is doing in there, or
> why this functions to generate the ASCII from the integer.
The P prints the top of stack. For numeric values it interprets them as
multiple bytes and dc's string constants (like [hello dc!]) would be
printed as is.
The A is a hex "digit", so 10 decimal, which is a linefeed.
some-long-nuber P # print that number as string
A P # add a LF
You can play with it easier after switching to hex numbers:
16 i 486920746865726521 P # is "Hi there!" without LF
A P # LF added now.
Alternatively:
16 i 4869207468657265210A P # includes the LF directly.
And for string to bigint I still use python2 because there `reduce`
needs not to be imported:
$ python2 -c 'print reduce(lambda x,y:(x<<8)+y,map(ord,"headyprimes"))'
126207040828807930834675059
And `factor` just is there...
$ factor 126207040828807930834675059
126207040828807930834675059: 3 47 541 1543 7027 7208759 21167561
--
( Are we there yet? ) / Time zones? \ .---------------.
\ \ Be patient! / | 2024-02-22 -> |
\ \ '---------------'
_______________________ _@o ____________ _@o _@o _______________|_______