Anonymous user
Bitwise operations: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 2,069:
=={{header|Maple}}==
<lang Maple>
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);
Line 2,079:
d:=Xor(A,B);
#Left Shift
e:=
#Right Shift
f :=
#Left Rotate
return a,b,c,d,e,f;▼
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;
</lang>
|