Language Elements |
Table 2-6. BASIC-SO Operators in Order of Precedence (Cont'd.)
Order | Operator | Example |
9.Logical NOT, used to invert a given
argument. | |
|
10.Logical AND, used to test if the nth bit of X
and the nth bit of Yare both on. | 1ANDO=O |
11.Logical OR, used to test if the nth bit of X or
Y equals 1. | 150RO=15 |
12.Logical exclusive OR, used to test if either
| the nth bit of X or the nth bit of Y = 1, but not | 15XOR7= 8 |
| both. |
|
13. | Logical implication, used to test if the nth bit | OFOFOH IMP OOFFH=OFFFOH |
| of X is on, then the nth bit of Y is on. | |
|
|
14.Logical equivalence, used to test if the nth
bit of X equals the nth bit of Y. | OFOFH EQV.OOFFH=OFOOFH |
|
Operators and Precedence of Evaluation
Complex expressions may be formed by combining constants and variables with arithmetic, logical, relational, and string operators.
Arithmetic Operators
There are seven arithmetic operators in
A= 8*(C*2.49) K1=(L+M) S RS = (83* Et .S)
Relational Operators
There are six relational operators in
IF (A*2.2)<>8*81 THEN 220
IF INT(A1) = INT(81) THEN A=B
IF A> B THEN IF 8>(C* VA#)THEN 340