Lua language has a delicate treatment for mathematical operations in order to simplify your life.
Arithmetic operators
note difference type vs math.type
Exponentiation and useful modulo
Basics maths functions
Precedence
No | Description |
---|---|
1 | ^ |
2 | unary operators (-, ~, #, not) |
3 | /, //, *, % |
4 | +, - |
5 | .. (concatenation) |
6 | <<, >> (bitwise shifts) |
7 | & (bitwise AND) |
8 | ~ (bitwise exclusive OR) |
9 | ▏(bitwise OR) |
10 | <, >, <=, >=, ==, ~= |
11 | and |
12 | or |
- Roberto Ierusalimschy, Programming in Lua, Fourth Edition.
- lua.org
Previous post
hey sorry to go off topic, i needed some help with steem python ,r u der on discord or steemit chat?
Hi, i'm sorry (long time), i'm reading about steem python, what happen?