# Relational operators

All relational operators compare the values of the operands and return True (-1) or False (0) as the result. All relational operators are binary.

Relational operators

| Relational operator | Operator name | Operator function |
| --- | --- | --- |
| &lt; | Less than | A numeric comparison is made if both operands<br>can be interpreted numerically. The operation returns the logical value<br>of the evaluation of the comparison. |
| &lt;= | Less than or equal | A numeric comparison is made if both operands<br>can be interpreted numerically. The operation returns the logical value<br>of the evaluation of the comparison. |
| &gt; | Greater than | A numeric comparison is made if both operands<br>can be interpreted numerically. The operation returns the logical value<br>of the evaluation of the comparison. |
| &gt;= | Greater than or equal | A numeric comparison is made if both operands<br>can be interpreted numerically. The operation returns the logical value<br>of the evaluation of the comparison. |
| = | Equals | A numeric comparison is made if both operands<br>can be interpreted numerically. The operation returns the logical value<br>of the evaluation of the comparison. |
| &lt;&gt; | Not equivalent to | A numeric comparison is made if both operands<br>can be interpreted numerically. The operation returns the logical value<br>of the evaluation of the comparison. |
| precedes |  | Unlike the &lt; operator no<br>attempt is made to make a numeric interpretation of the argument values<br>before the comparison. The operation returns true if the value to the<br>left of the operator has a text representation which, in string comparison,<br>comes before the text representation of the value on the right.<br><br>Example:<br><br><br>` '1 ' precedes ' 2'  ` returns FALSE<br><br>whilst<br><br>`' 1' precedes ' 2'` returns TRUE<br><br>as the ASCII value of a space (' ') is of less value than the ASCII value of a number.<br><br>Compare this to:<br><br>` '1 ' < ' 2'  `returns TRUE<br><br>and<br><br>`' 1' < ' 2'` returns TRUE |
| follows |  | Unlike the &gt; operator no<br>attempt is made to make a numeric interpretation of the argument values<br>before the comparison. The operation returns true if the value to the<br>left of the operator has a text representation which, in string comparison,<br>comes after the text representation of the value on the right.<br><br>Example:<br><br>`' 2' follows '1` ' returns FALSE<br><br>whilst<br><br>' 2' follows ' 1' returns TRUE<br><br>as the ASCII value of a space (' ') is of less value than the ASCII value of a number.<br><br>Compare this to:<br><br>`' 2' > ' 1'` returns TRUE<br><br>and<br><br>`' 2' > '1 '` returns TRUE |