Precedence

<< Click to Display Table of Contents >>

Navigation:  Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > The Language and syntax > Expressions >

Precedence

Precedence

Operator precedence in Lua follows the table below, from lower to higher priority:

or

and

<     >     <=    >=    ∼=    ==

..

+     -

*     /     %

not   #     - (unary)

^

As usual, you can use parentheses to change the precedences of an expression. The concatenation (’..’) and exponentiation (’^’) operators are right associative. All other binary operators are left associative.