Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Boolean

Booleans in Andy C++ represent a binary state, capable of holding either the value true or false. Unlike some other languages, where booleans are often used as numbers, Andy C++ treats them as a distinct type. When attempting to perform arithmetic operations with booleans, such as true + true, Andy C++ will throw an error because these operations are not defined for this type.

Operators defined for booleans:

OperatorFunction
&non-lazy and
|non-lazy or
~non-lazy xor
!not
orlazy logical or
andlazy logical and
notlogical not like ! but lower precedence

See Logical operators for short-circuiting and precedence rules.