Bitwise operations: Difference between revisions

(added ocaml)
Line 197:
not a: -256
</pre>
=={{header|Smalltalk}}==
Since [[GNU Smalltalk]] by default runs without a graphical user interface, I wrote the program in that dialect. The actual methods for bitwise operations (''bitAnd:'', etc.) are the same in all implementations.
 
a := stdin nextLine asInteger.
b := stdin nextLine asInteger.
('a and b: %1' % {a bitAnd: b}) displayNl.
('a or b: %1' % {a bitOr: b}) displayNl.
('a xor b: %1' % {a bitXor: b}) displayNl.
('not a: %1' % {a bitInvert}) displayNl.
Anonymous user