summaryrefslogtreecommitdiff
path: root/55/CH15/EX15.1/15ex1.sci
blob: 1f413dba16a682fdf9d905a6c6ed4bd24bf4995a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//0 denotes False and 1 denotes true
b=[0,1];
//binary operation  + on the set of bits
for i=1:2
for j=1:2
k = b(i)& b(j);
disp(k)
end
end
//binary operation  * on the set of bits
for i=1:2
for j=1:2
k = b(i)| b(j);
disp(k)
end
end
//unary operation ' on the set of bits
k=~b
clear;
D=[1,2,5,7,10,14,35,70];
a=35;
b=70;
V=int32([a,b]);
thelcm=lcm(V)  //a+b=lcm(a,b)
V=int32([a,b])  
thegcd=gcd(V)  //a*b=gcd(a,b)
abar=70/a      //a'=70/a