TAL Programmer's Guide
Precedence of Operators
Using Expressions
096254 Tandem Computers Incorporated 5–13
Precedence of
Operators
Operators in expressions can be arithmetic (signed, unsigned, or logical) or conditional
(Boolean or relational, signed or unsigned).
Within an expression, the compiler evaluates operators in order of precedence. Within
each level of precedence, the compiler evaluates operators from left to right. Table 5-8
shows the level of precedence for each operator, from highest (0) to lowest (9).
Table 5-8. Precedence of Operators (Page 1 of 2)
Operator Operation Precedence
[
n
] Indexing 0
. Dereferencing
*
0
@ Address of identifier 0
+ Unary plus 0
– Unary minus 0
.<...> Bit extraction 1
<< Signed left bit shift 2
>> Signed right bit shift 2
'<<' Unsigned left bit shift 2
'>>' Unsigned right bit shift 2
* Signed multiplication 3
/ Signed division 3
'*' Unsigned multiplication 3
'/' Unsigned division 3
'\' Unsigned modulo division 3
+ Signed addition 4
– Signed subtraction 4
'+' Unsigned addition 4
'–' Unsigned subtraction 4
LOR Bitwise logical OR 4
LAND Bitwise logical AND 4
XOR Bitwise exclusive OR 4
< Signed less than 5
= Signed equal to 5
> Signed greater than 5
<= Signed less than or equal to 5
>= Signed greater than or equal to 5
<> Signed not equal to 5
*
Not portable to future software platforms.