Logical Operators
The logical operators combine two bool values into a bool.
&&logical conjunction||logical disjunction
Process
At runtime:
- the left operand is evaluated;
- if its value already determines the result, that value is the expression's value, and nothing further is evaluated; and
- otherwise, the right operand is evaluated, and its value is the expression's value.
Assertions
- Both operands have type
bool, and the result has typebool.
Syntax
logical_conjunction_operator = ampersand_ampersand ;
logical_disjunction_operator = vertical_bar_vertical_bar ;