User Guide

Advanced
Coding Card
Pack
COMPARISON OPERATORS
Are used to compare two values to each other and can also be used to control the flow
of a program based on the value of a number or variable. The 'equal to' comparator is
also referred to in coding as two equal signs back-to-back ‘==’. It is not setting two
things equal but is returning 'true' if two things are equal. You will often want to
compare two things and do something if they are equal, like checking if the current
time is equal to the alarm you have set.
The not-equal-to operator ( != ) returns true if the operands don't have the same value;
otherwise, it returns false.
The less-than and greater-than comparators return 'true' when the comparison is true
and false when the condition is not-true.
The less-than and greater-than comparators return 'true' when the comparison is true
and false when the condition is not-true.
38