Boolean

From Codex Gamicus
Jump to: navigation, search

A form of logic named for the mathematician George Boole, Boolean values are common in computer programming since computers themselves (namely the bit) are built on an on/off mechanic.

A Boolean value or expression is one that evaluates to either 0 (false) or 1 (true). The Boolean operators are AND, NAND, OR, NOR, NOT, and XOR.

The Boolean operators (all except NOT take two operands):

  • AND evaluates true if and only if both operands are true
  • NAND evaluates true unless both operands are true (Not AND)
  • OR evaluates true if at least one operand is true
  • NOR evaluates true if and only if both operands are false (Not OR)
  • NOT evaluates true if and only if its operand is false
  • XOR evaluates true if and only if one operand is true and the other is false (eXclusive OR)

Boolean logic is the basic foundation of computer algorithms and software.