Anonymous user
Bitwise operations: Difference between revisions
no edit summary
m (→{{header|D}}: remove incorrect; added shifts (not tested, hard time compiling gdc)) |
No edit summary |
||
Line 726:
print ("a asr b: " ^ Word.fmt StringCvt.DEC (Word.>> (a, b) ) ^ "\n") (* logical right shift *)
)</lang>
=={{header|Tcl}}==
<lang tcl>proc bitwise {a b} {
puts [format "a and b: %d" [expr {$a & $b}]]
puts [format "a or b: %d" [expr {$a | $b}]]
puts [format "a xor b: %d" [expr {$a ^ $b}]]
puts [format "not a: %d" [expr {~$a}]]
puts [format "a << b: %d" [expr {$a << $b}]]
puts [format "a >> b: %d" [expr {$a >> $b}]]
}</lang>
=={{header|Visual Basic .NET}}==
|