Precedence

3.4.8 – Precedence

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

or
and
<     >     <=    >=    ~=    ==
|
~
&
<<    >>
..
+     -
*     /     //    %
unary operators (not   #     -     ~)
^

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.

doc_lua
2017-02-21 04:15:43
Comments
Leave a Comment

Please login to continue.