Numeric Relational Operators

M relational operators always generate a result of TRUE (1) or FALSE (0). All numeric relational operators force M to evaluate the expressions to which they apply as numeric. The numeric relational operators are:

>binary arithmetic greater than

<binary arithmetic less than

The equal sign (=) does not force numeric evaluation, and should be viewed as a string operator. However, the equal sign between two numeric values tests for numeric equality.

Other numeric relations are formed using the logical NOT operator apostrophe (') as follows:

'> not greater than, that is, less than or equal to

'< not less than, that is, greater than or equal to

'= not equal, numeric or string operation

Example:

         GTM>WRITE 1>2
         0
         GTM>WRITE 1<2
         1
         GTM>
        

The above example demonstrates the basic arithmetic relational operations.

Example:

         GTM>WRITE 1'<2
         0
         GTM>WRITE 2'<1
         1
         GTM>
        

The above example demonstrates combinations of arithmetic, relational operators with the logical NOT operator.