Fingerprint ID: | 0x4c4f4e47 |
---|

New in version 0.5-rc2.

This fingerprint, from RC/Funge-98, implements arithmetic operations of the long integers. It provides the following commands:

`A`:*a*^{L}*b*^{L}—*(a+b)*^{L}- Adds two long integers.
`B`:*x*^{L}—*abs(x)*^{L}- Calculates the absolute value of
*x*. `D`:*a*^{L}*b*^{L}—*(a÷b)*^{L}- Divides two long integers. If the divisor is zero it pushes zero. PyFunge tries to emulate RC/Funge-98’s behavior as much as possible, so it uses C-like division (remainder’s sign is same to dividend’s one) instead of Python division.
`E`:*x*—*x*^{L}- Pushes a long integer from given integer.
`L`:*a*^{L}*n*—*(a << n)*^{L}- Shift
*a*left by*n*bits. Reflects if*n*is negative. `M`:*a*^{L}*b*^{L}—*(a×b)*^{L}- Multiplies two long integers.
`N`:*x*^{L}—*-x*^{L}- Negates the long integer.
`O`:*a*^{L}*b*^{L}—*(a mod b)*^{L}- Calculates the remainder of two long integers. If the divisor is zero it pushes zero. PyFunge tries to emulate RC/Funge-98’s behavior as much as possible, so it uses C-like division (remainder’s sign is same to dividend’s one) instead of Python division.
`P`:*x*^{L}—- Prints the long integer.
`R`:*a*^{L}*n*—*(a >> n)*^{L}- Shift
*a*right by*n*bits. Reflects if*n*is negative. `S`:*a*^{L}*b*^{L}—*(a-b)*^{L}- Subtracts two long integers.
`Z`:*str*^{s}—*x*^{L}- Tries to parse the string into the long integer. Reflects on failure.

Long integer is not that long in PyFunge, since it is restricted to 64 bits. It can be useful for implicitly wrapping integers (as in C and other languages) though. Long integer occupies two stack cells: the bottom one is the upper 32 bits, and the top one is the lower 32 bits. All bits over 32 bit boundary are ignored.