
Menu
Historical Overview
Definitions
Different names
Operators
Precedence rules
Truth Tables
Examples of Boolean Expressions
Purpose
Usage examples
Quiz
|
Precedence rules
Boolean operators follow conventional precedence rules
NOT has highest precedence, then AND and lastly OR.
Parenthesis can be used to override the precedence rules. For example:
p AND NOT q OR u will be evaluated as follows: firstly q will be negated.
Next step is to evaluate p AND NOT q. The result of this evaluation will
be used in OR expression with u.
Let us take the same expression but put some parenthesis there.
p AND NOT (q OR u)
now order of evaluation is different. We negate the result of q OR u
expression, which is evaluated first, and AND it to p.
|