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 and b: " . a & b
msgbox % "a or b: " . a | b
MsgBox % "a or b: " . a | b
msgbox % "a xor b: " . a ^ b
MsgBox % "a xor b: " . a ^ b
msgbox % "not a: " . ~a ; treated as unsigned integer
MsgBox % "not a: " . ~a ; treated as unsigned integer
msgbox % "a << b: " . a << b ; left shift
MsgBox % "a << b: " . a << b ; left shift
msgbox % "a >> b: " . a >> b ; arithmetic right shift
MsgBox % "a >> b: " . a >> b ; arithmetic right shift
}
}

</lang>
</lang>