rpn
rpn copied to clipboard
Bitwise AND OR XOR NOT SHIFT
We can keep the same notation as Fabrice Bellard's numcalc, which is
a&b Bitwise and between the integers a and b
a|b Bitwise or between the integers a and b
a^^b Bitwise exclusive or between the integers a and b
~n Bitwise not of the integer n
a<<n Shift left by n bits. Equivalent to floor(a*2^(-n))
a>>n Shift right by n bits. Equivalent to floor(a/2^n)
So
a b &
a b |
a b ^^
n ~
a n <<
a n >>