Hi guys,
This is probably pretty basic... but I don't seem to get it:
How does
(2 & 1) = 0
(3 & 1) = 1
(4 & 1) = 0
etc..
This pattern above seems to help find even numbers
or
(0 | 1) = 1
(1 | 1) = 1
(2 | 1) = 3
(3 | 1) = 4
(4 | 1) = 5
(5 | 1) = 5
I know how boolean algebra works between bits. But I don't understand how Boolean algebra works with integers (in C# at the least).
thanks in advance.