Bitwise operations: Difference between revisions
Content added Content deleted
(+AutoHotkey) |
m (→{{header|AutoHotkey}}: Minor indentation and casing edit) |
||
Line 149: | Line 149: | ||
bitwise(a, b) |
bitwise(a, b) |
||
{ |
{ |
||
MsgBox % "a and b: " . a & b |
|||
MsgBox % "a or b: " . a | b |
|||
MsgBox % "a xor b: " . a ^ b |
|||
MsgBox % "not a: " . ~a ; treated as unsigned integer |
|||
MsgBox % "a << b: " . a << b ; left shift |
|||
MsgBox % "a >> b: " . a >> b ; arithmetic right shift |
|||
} |
} |
||
</lang> |
</lang> |
||