rpn icon indicating copy to clipboard operation
rpn copied to clipboard

Bitwise AND OR XOR NOT SHIFT

Open louisrubet opened this issue 2 years ago • 0 comments

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 >>

louisrubet avatar Aug 15 '23 12:08 louisrubet