Versions/v1.2.0-alpha.06/English

Boolean Type

Sections3
On This Page3
API Symbols3

Boolean Type

The Boolean type is denoted by Bool and is used to represent logical true and false values.

Boolean Literals

The Boolean type has only two literals: true and false.

The following example demonstrates the use of Boolean literals:

cangjie
let a: Bool = true
let b: Bool = false

Supported Operations for Boolean Type

Boolean types support the following operators: logical operators (logical NOT !, logical AND &&, logical OR ||), partial relational operators (== and !=), and partial compound assignment operators (&&= and ||=).