Boolean Values

Boolean data has one of only two values, true or false. Some operators and primitives return Boolean values. For example, the statement 1==2 will return false. Boolean values are used in control structures such as the if statement.

All primitives that require a Boolean value as an input will also accept a numeric or text value. The number zero is converted to the Boolean value false and all other numbers are converted to true. In addition, all text strings other than the empty string are converted to true.

Each of the following data items is converted to true when evaluated as a Boolean value:


Similarly, each of the following items is converted to false:


All primitives that require a number as an input will accept a Boolean value as well. The value true is converted to one and false is converted to zero. For example, the statement true+1 will return 2.

Vanguard Software Applications

Our collaborative, web-based forecasting applications unite roles, teams and departments in achieving the most accurate forecasts in the world – bar none.