Bitwise operations: Difference between revisions

m
m (→‎{{header|Sidef}}: updated code)
Line 3,083:
=={{header|Sidef}}==
<lang ruby>func bitwise(a, b) {
say ('a xorand b : ', a ^& b);
 
#say Make('a sureor theyb are integers: ', a | b)
say ('a orxor b : ', a |^ b);
a.to_int!;
say ('not a : ', ~a);
b.to_int!;
say ('a << b : ', a << b); # left shift
 
say ('a and>> b : ', a &>> b); # arithmetic right shift
say ('a or b : ', a | b);
say ('a xor b : ', a ^ b);
say ('not a : ', ~a);
say ('a << b : ', a << b); # left shift
say ('a >> b : ', a >> b); # arithmetic right shift
}
 
bitwise(14,3)</lang>
{{out}}
2,756

edits