![]() |
![]() |
![]() |
![]() |
![]() |
|
Note the difference between | and ||. The bitwise-or
operator, |, treats an integer operand of any length as a set of
independent entities, each of which can be 0 or 1. The ordinary-or
operator, ||, treats an integer operand as a whole: If its value is
0, the integer as a whole represents false; if its value is not zero,
with any number of bits set, the integer as a whole represents true.