Bitwise operations: Difference between revisions
Content added Content deleted
m (→{{header|Ada}}) |
m (→{{header|Ada}}) |
||
Line 96: | Line 96: | ||
<lang ada>with Ada.Text_IO, Interfaces; |
<lang ada>with Ada.Text_IO, Interfaces; |
||
use Ada.Text_IO, Interfaces; |
use Ada.Text_IO, Interfaces; |
||
⚫ | |||
subtype Byte is Unsigned_8; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
subtype Byte is Unsigned_8; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
B : constant Byte := 2#11110100#; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
New_Line (2); |
New_Line (2); |
||
Put_Line (Unsigned_8'Image (Shift_Left (X, N))); |
Put_Line (Unsigned_8'Image (Shift_Left (X, N))); |
||
Put_Line (Unsigned_8'Image (Shift_Right (X, N))); |
Put_Line (Unsigned_8'Image (Shift_Right (X, N))); |
||
Put_Line (Unsigned_8'Image (Shift_Right_Arithmetic(X, N))); |
Put_Line (Unsigned_8'Image (Shift_Right_Arithmetic (X, N))); |
||
Put_Line (Unsigned_8'Image (Rotate_Left (X, N))); |
Put_Line (Unsigned_8'Image (Rotate_Left (X, N))); |
||
Put_Line (Unsigned_8'Image (Rotate_Right (X, N))); |
Put_Line (Unsigned_8'Image (Rotate_Right (X, N))); |
||
end Bitwise;</lang> |
|||
=={{header|Aikido}}== |
=={{header|Aikido}}== |