And, or, either (&& || ^)
Combines TRUE and FALSE values.
Syntax
a && b
a || b
a ^ b
Result
TRUE or FALSE: && when both are TRUE; || when either is; ^ when one is and the other isn't.
Examples
In the example drawing:
| Expression | Gives |
|---|---|
TRUE&&FALSE |
FALSE |
TRUE\|\|FALSE |
TRUE |
TRUE^TRUE |
FALSE |
L>100&&W>100 |
TRUE |
TRUE\|\|FALSE&&FALSE |
FALSE |
TRUE\|\|(FALSE&&FALSE) |
TRUE |
Notes
&&, || and ^ come together, and are worked out left to right: TRUE||FALSE&&FALSE is
(TRUE||FALSE)&&FALSE, which is FALSE. Use brackets to say which goes first. Both sides are always worked out, even
when the first one decides the answer.