Bitwise operations: Difference between revisions

Content added Content deleted
(Added BBC BASIC)
(Delphi)
Line 334: Line 334:
RSH : 11111111 >> 00000010 = 00000000000000000000000000111111 ( 63)
RSH : 11111111 >> 00000010 = 00000000000000000000000000111111 ( 63)
NOT : ~ 11111111 = 11111111111111111111111100000000 (-256)</pre>
NOT : ~ 11111111 = 11111111111111111111111100000000 (-256)</pre>

=={{header|Delphi}}==
<lang Delphi>program Bitwise;

{$APPTYPE CONSOLE}

begin
Writeln('2 and 3 = ', 2 and 3);
Writeln('2 or 3 = ', 2 or 3);
Writeln('2 xor 3 = ', 2 xor 3);
Writeln('not 2 = ', not 2);
Writeln('2 shl 3 = ', 2 shl 3);
Writeln('2 shr 3 = ', 2 shr 3);
// there are no built-in rotation operators in Delphi
Readln;
end.</lang>


=={{header|E}}==
=={{header|E}}==