Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Bitwise-operations/Maple/bitwise-operations.maple
Normal file
18
Task/Bitwise-operations/Maple/bitwise-operations.maple
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
with(Bits):
|
||||
bit:=proc(A,B)
|
||||
local a,b,c,d,e,f,g,h,i,x,bitpow;
|
||||
bitpow := 2^B:
|
||||
a:=And(A,B);
|
||||
b:=Not(A);
|
||||
c:=Or(A,B);
|
||||
d:=Xor(A,B);
|
||||
#Left Shift
|
||||
e:= irem(2*A,bitpow);
|
||||
#Right Shift
|
||||
f := iquo(A,2);
|
||||
#Left Rotate
|
||||
g:= irem(2*A,bitpow,'x')+x;
|
||||
#Rightarithshift
|
||||
i:= iquo(A,2)+bitpow/2*irem(A,bitpow/2);
|
||||
return a,b,c,d,e,f,g,i;
|
||||
end proc;
|
||||
Loading…
Add table
Add a link
Reference in a new issue