Bob said:
Hello.
What do these two statements mean?
1)
#define stuff(x) (x >> 3)
2)
#define stuff1(x) (x & 7)
Thanks in advance,
Bob
I'm not sure about 1. Number 2 means, "Perform a `logical and' operation
using x and 7 as operands."
This `logical and' operation is done on numbers in the base 2 number system
(binary number system). Seven is 0000 0111 in this binary (base 2) number
system. Now, let's say I take 1100 0011 and perform this `&' operation
on these two numbers. ---------
It's really simple. All you do is put a 1 underneath the dotted line when,
and only when, the two numbers above it are also 1. So,
0000 0111
& 1100 0011
---------
0000 0011
It's actually simpler than the addition and subtraction we learned
as children!
If you would like help on how to convert numbers to the binary (base 2) number
system, you may email me privately.
--Steve