RosettaCodeData/Task/Bitwise-operations/Inform-6/bitwise-operations.inf

16 lines
422 B
INI

[ bitwise a b temp;
print "a and b: ", a & b, "^";
print "a or b: ", a | b, "^";
print "not a: ", ~a, "^";
@art_shift a b -> temp;
print "a << b (arithmetic): ", temp, "^";
temp = -b;
@art_shift a temp -> temp;
print "a >> b (arithmetic): ", temp, "^";
@log_shift a b -> temp;
print "a << b (logical): ", temp, "^";
temp = -b;
@log_shift a temp -> temp;
print "a >> b (logical): ", temp, "^";
];