June 2017
Beginner
502 pages
11h 26m
English
This is what we would call exclusive OR or XOR: the result will be 1 only if at the same slot, there is only a 1, and if there are two 1, the result will be 0:
zarrelli:~$ x=50 ; y=20; echo $((x^y))38
So, let's check again with our matrix:
|
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|
|
50 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
|
20 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
|
^ |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
And that is, 36.
Read now
Unlock full access