Quote:
Originally posted by Tazlikesrobots
Thanks for the help. It does not make a whole lot of sence since "&" and "and" are the same thing, however it works now!
|
They actually aren't AND is the logical version (like C's && if that helps) whereas & is the bitwise version (like C's &). For more detail, see
this post.
Taking your previous code, assume sw1=1, sw2=0, sw3=1. Evaluate left to right:
sw1 & sw2 & sw3 => 1 & 0 & 1, which is 0. Then apply the comparison evaluator, 0=0, which evaluates to true. Thus if
any of the switches are 0, this will evaluate to true.