RosettaCodeData/Task/Bitwise-operations/Logo/bitwise-operations-1.logo
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

11 lines
361 B
Text

to bitwise :a :b
(print [a and b:] BitAnd :a :b)
(print [a or b:] BitOr :a :b)
(print [a xor b:] BitXor :a :b)
(print [not a:] BitNot :a)
; shifts are to the left if positive, to the right if negative
(print [a lshift b:] LShift :a :b)
(print [a lshift -b:] LShift :a minus :b)
(print [-a ashift -b:] AShift minus :a minus :b)
end
bitwise 255 5