Skip to main content

Define a Boolean

On/Off, 1/0, True/False. Lots of data information comes in pairs. We call this data type a boolean. For simplicity a boolean value can either be true or false, but you can use it to define any type of data pair you want.

Boolean values

The keywords true and false are a special on the Decipad Language because they represent a boolean value. Take a look at these examples:

Example 1:

When you use the keyworkds true or false they will return themselves since they represent a value.

Example 2:

The next time you need to say that something is On or Off you can use a boolean data type!

Comparing values

Compare two values like this:

In this example, the comparison result is true.

The list of available comparators is the following:

  • >: "greater than"
  • <: "less than"
  • >=: "greater or equal"
  • <=: "less or equal"
  • ==: "equals"
  • !=: "different"

Parenthesis

Use parenthesis to chain operators and define priorities

Parentheses are used to ensure that the / operation on the right side of the != is performed before the evaluation of the != itself.

Formulas on booleans

Here is a list of all the functions that work on booleans.