TAL Reference Manual

Expressions
TAL Reference Manual526371-001
4-3
Precedence of Operators
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 the operators in the order of precedence. Within each level of precedence,
the compiler evaluates the operators from left to right. Table 4-1
shows the level of
precedence for each operator, from highest (0) to lowest (9).
Table 4-1. 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