mirror of https://github.com/arendst/Tasmota.git
15 lines
221 B
Python
15 lines
221 B
Python
|
# and, or, xor
|
||
|
a = 11
|
||
|
assert(a & 0xFE == 10)
|
||
|
assert(a | 32 == 43)
|
||
|
assert(a ^ 33 == 42)
|
||
|
|
||
|
# same with literal
|
||
|
assert(11 & 0xFE == 10)
|
||
|
assert(11 | 32 == 43)
|
||
|
assert(11 ^ 33 == 42)
|
||
|
|
||
|
# flip
|
||
|
assert(~a == -12)
|
||
|
assert(~11 == -12)
|