RosettaCodeData/Task/Bitwise-operations/Elena/bitwise-operations.elena

20 lines
555 B
Text
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
import extensions;
2013-04-10 16:57:12 -07:00
2017-09-23 10:01:46 +02:00
extension testOp
2015-11-18 06:14:39 +00:00
{
2019-09-12 10:33:56 -07:00
bitwiseTest(y)
{
console.printLine(self," and ",y," = ",self.and(y));
console.printLine(self," or ",y," = ",self.or(y));
console.printLine(self," xor ",y," = ",self.xor(y));
console.printLine("not ",self," = ",self.Inverted);
console.printLine(self," shr ",y," = ",self.shiftRight(y));
console.printLine(self," shl ",y," = ",self.shiftLeft(y));
}
2015-11-18 06:14:39 +00:00
}
2013-04-10 16:57:12 -07:00
2019-09-12 10:33:56 -07:00
public program()
{
console.loadLineTo(new Integer()).bitwiseTest(console.loadLineTo(new Integer()))
}