if (($a == 3) || ($a == 77) || ($a == 8)) -- is equivalent to -- if (($a != 3) && ($a != 77) && ($a != 8))
No, those two aren't equivalent, they're exact opposites. It seems you didn't apply what you said:
when changing the nested logic in a condition such as that you must necessarily change the higher level logic if you wish for the original to be equivalent to the negated version.
if (($a == 3) || ($a == 77) || ($a == 8)) -- is equivalent to -- if (!( ($a != 3) && ($a != 77) && ($a != 8) ))
In reply to Re^3: Multiple numeric not or compare in if statement
by haukex
in thread Multiple numeric not or compare in if statement
by RedJeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |