Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Bitwise-operations/MATLAB/bitwise-operations-1.m
Normal file
9
Task/Bitwise-operations/MATLAB/bitwise-operations-1.m
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function bitwiseOps(a,b)
|
||||
|
||||
disp(sprintf('%d and %d = %d', [a b bitand(a,b)]));
|
||||
disp(sprintf('%d or %d = %d', [a b bitor(a,b)]));
|
||||
disp(sprintf('%d xor %d = %d', [a b bitxor(a,b)]));
|
||||
disp(sprintf('%d << %d = %d', [a b bitshift(a,b)]));
|
||||
disp(sprintf('%d >> %d = %d', [a b bitshift(a,-b)]));
|
||||
|
||||
end
|
||||
6
Task/Bitwise-operations/MATLAB/bitwise-operations-2.m
Normal file
6
Task/Bitwise-operations/MATLAB/bitwise-operations-2.m
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
>> bitwiseOps(255,2)
|
||||
255 and 2 = 2
|
||||
255 or 2 = 255
|
||||
255 xor 2 = 253
|
||||
255 << 2 = 1020
|
||||
255 >> 2 = 63
|
||||
Loading…
Add table
Add a link
Reference in a new issue