Table of Content
Variable of boolean type are defined by the keyword bool
. They can contain a constant value of either true
or false
;
!
(logical negation)&&
(logical conjunction, "and")||
(logical disjunction, "or")==
(equality)!=
(inequality)
The operators ||
and &&
apply the common short-circuiting rules. This means that in the expression f(x) || g(y)
, if f(x)
evaluates to true
, g(y)
will not be evaluated even if it may have side-effects.
The following comparison operators <=
(less than or equal), <
(less than), ==
, !=
, >=
, >
evaluate to a boolean value.