RosettaCodeData/Task/Bitwise-operations/11l/bitwise-operations.11l

13 lines
326 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
V x = 10
V y = 2
print(x = x)
print(y = y)
2024-03-06 22:25:12 -08:00
print(NOT x = (~x))
2023-07-01 11:58:00 -04:00
print(x AND y = (x [&] y))
print(x OR y = (x [|] y))
print(x XOR y = (x (+) y))
print(x SHL y = (x << y))
print(x SHR y = (x >> y))
print(x ROL y = rotl(x, y))
print(x ROR y = rotr(x, y))