Comparison Operators

A comparison operator compares its operands and returns a logical value based on whether the comparison is true. The operands can be numerical or string values. When used on string values, the comparisons are based on the standard lexicographical ordering.

Note:

The comparison operators in the following table are only available at the local metatopic level. For the examples in the table var1 has been assigned the value 3, and var2 has been assigned the value 4.

Table 28. Comparison Operators (Local Metatopic Level) 

Operator

Return “true” if the:

==

Operands are equal

For example, 3 == var1

!=

Operands are not equal

For example, var1!= 4

<

Left operand is less than the right operand

For example, var1 < var2

<=

Left operand is less than or equal to the right operand

For example, var <= var2, var2 <= 5

>

Left operand is greater than the right operand

For example, var2 > var1

>=

Left operand is greater than or equal to the right operand

For example, var2 >= var1, var1 >= 3