July 2018
Beginner
202 pages
5h 42m
English
Arithmetic operators do math; these operators work on numbers to perform addition, subtraction, multiplication, and division. Operators to find the remainder of a division, negate a number, or raise a number to a power are also available in Lua. The negation operator uses a minus sign and is a unary operator; otherwise, all other arithmetic operators are binary operators (that is, they work on two operands).
The addition operator (+) adds two operands together:
x = 7 + 10y = x + 3z = x + y
The subtraction operator (-) will subtract the second operand from the first:
x = 8 - 3y = 10 - xz = x - y
The multiplication operator (*) will multiply the given operands:
x = 2 * 2y = x * 3z = x * y
The division operator (/) will ...