Bitwise operations: Difference between revisions
Content added Content deleted
m (Added to <20 category) |
No edit summary |
||
Line 15: | Line 15: | ||
A : Byte := 255; |
A : Byte := 255; |
||
B : Byte := 170; |
B : Byte := 170; |
||
begin |
begin |
||
Put("A and B = "); Byte_Io.Put(Item => A and B, Base => 2); New_Line; |
Put("A and B = "); Byte_Io.Put(Item => A and B, Base => 2); New_Line; |
||
Line 165: | Line 165: | ||
\ a \ 7 bitwise # hex literals |
\ a \ 7 bitwise # hex literals |
||
=={{header|MAXScript}}== |
|||
fn bitwise a b = |
|||
( |
|||
format "a and b: %\n" (bit.and a b) |
|||
format "a or b: %\n" (bit.or a b) |
|||
format "a xor b: %\n" (bit.xor a b) |
|||
format "not a: %\n" (bit.not a) |
|||
) |
|||
bitwise 255 170 |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |