Bitwise Operators: Difference between revisions

m
m (→‎AND: Removed the "8 bit architecture" explanation since no reference to 8 bits was made in the properties.)
Line 70:
When we say "or" in the English language, we usually mean "one or the other, but not both." This isn't the case in programming. That's actually a different operator which will be covered later.
 
A few properties of OR that aren't readily apparent. These assume an 8-bit architecture but also apply to other architectures as well if you add enough trailing ones to fill the variable size. (8 bit was chosen for brevity's sake.)
For all numbers A:
* <code>A | 0 = A</code>
1,489

edits