There are also operators for equalities and inequalities, called
RELATIONAL operators. Arithmetic operators always take priority
over relational operators.
< = or = <
> = or = >
< > or > <
<
>
is equal to
is less than
is greater than
is less than or equal to
is greater than or equal to
is not equal to
Finally, there are three LOGICAL operators, with lower priority
than both arithmetic and relational operators:
NOT
These are most often used to join multiple formulas in IF ... THEN
statements. When they are used with arithmetic operators, they
are evaluated last (i.e., after + and -). If the relationship stated in
the expression is true, the result is assigned an integer value of -
1. If false, a value of 0 is assigned.
EXAMPLES:
IF A=B AND C=D THEN 100 Requires both A=B &
PRINT 123 AND 15:PRINT 5 OR 7 Displays 11 and 7
AND
OR
A=5:B=4:PRINT A=B
A=5:B=4:PRINT A>3
IF A=B OR C=D THEN 100
C=D to be true
Allows either A=B, C=D,
or both, to be true
Displays a value of 0
Displays a value of -1
19-6