User Guide

Chapter 4: ColdFusion Expressions: Operators and Other Constructs 579
Boolean operators
Boolean, or Logical, operators perform logical connective and negation operations.
The operands of Boolean operators are Boolean (TRUE/FALSE) values.
Operator Precedence
The order of precedence controls which operator is evaluated first in an expression.
Operators on the same line have the same precedence.
Unary +, Unary -
^
*, /
\
MOD
+, -
&
EQ, NEQ, LT, LTE, GT, GTE, CONTAINS, DOES NOT CONTAIN
NOT
AND
OR
Boolean Operators
Operator Description
NOT Reverses the value of an argument. For example, NOT
TRUE is FALSE and vice versa.
AND Returns TRUE if both arguments are TRUE; returns FALSE
otherwise. For example, TRUE AND TRUE is TRUE, but
TRUE AND FALSE is FALSE.
OR Returns TRUE if any of the arguments is TRUE; returns
FALSE otherwise. For example, TRUE OR FALSE is TRUE,
but FALSE OR FALSE is FALSE.
XOR Exclusive or—either, or, but not both. Returns TRUE if the
truth values of both arguments are different; returns
FALSE otherwise. For example, TRUE XOR TRUE is FALSE,
but TRUE XOR FALSE is TRUE.
EQV Equivalence both true or both false. The EQV operator is
the opposite of the XOR operator. For example, TRUE EQV
TRUE is TRUE, but TRUE EQV FALSE is FALSE.
IMP Implication. A IMP B is the truth value of the logical
statement “If A Then B.” A IMP B is FALSE only when A is
TRUE and B is FALSE.