Booleans
The bool
type in Noir has two possible values: true
and false
:
fn main() {
let t = true;
let f: bool = false;
}
Note: When returning a boolean value, it will show up as a value of 1 for
true
and 0 forfalse
in Verifier.toml.
The boolean type is most commonly used in conditionals like if
expressions and assert
statements. More about conditionals is covered in the Control Flow and
Assert Function sections.