Boolean

Applies to: general

A boolean is a value that is either true or false. Comparisons (==, <, >) produce booleans, and logical operators combine them: AND (both true), OR (either true), NOT (flip).

bool moving = (speed != 0.0);      // comparison -> bool
bool safe   = moving && (dist > 1) // logical AND

See also: conditional