Specifications
78
6.2 Operator Precedence
When an expression contains more than one operator, BHT-BASIC performs the operations in
the standard precedence as shown below.
Precedence
1. Parentheses ( )
The parentheses allow you to override operator precedence; that is, operations
enclosed with parentheses are first carried out.
For improving the readability of an expression, you can use parentheses to separate
two operators placed in succession.
2. Function operations
3. Arithmetic operations
4. Relational operations
=, <>, ><, <, >, <=, >=, =<, =>
5. Logical operations
6. String operations
Operations Arithmetic Operators Precedence
Negation
_
1
Multiplication and division
* and /
2
Modulo arithmetic
MOD
3
Addition and subtraction
+ and _
4
Operations Logical Operators Precedence
Logical negation
NOT
1
Logical multiplication
AND
2
Logical addition
OR
3
Exclusive logical addition
XOR
4