#!/usr/bin/ruby

#
## https://rosettacode.org/wiki/Bitwise_operations
#

func bitwise(a, b) {
 
   # Make sure they are integers
   a.to_int!;
   b.to_int!;
 
   say ('a and b : ',  a & b);
   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)