Bitwise operations: Difference between revisions

Added Robotic implementation for Bitwise operations
mNo edit summary
(Added Robotic implementation for Bitwise operations)
Line 4,268:
>> z = x / i2; printf("0x%08x\n",z); // right-shift is division by 2 where both arguments are integers
0x00000001</lang>
 
=={{header|Robotic}}==
<lang robotic>
input string "First value"
set "local1" to "input"
input string "Second value"
set "local2" to "input"
 
. ">>> is an arithmetic shift; >> is a logical shift"
[ "a AND b = ('local1' a 'local2')"
[ "a OR b = ('local1' o 'local2')"
[ "a XOR b = ('local1' x 'local2')"
[ "NOT a = (~'local1')"
[ "a << b = ('local1' << 'local2')"
[ "a >> b = ('local1' >> 'local2')"
[ "a >>> b = ('local1' >>> 'local2')"
end
. "Bitwise rotation is not natively supported"
</lang>
 
=={{header|Ruby}}==
Anonymous user