Arithmetic operators
Arithmetic operators
Arithmetic operators are applied in mathematical operations, and the result of their application is always a number.
| Operator | Explanation | Unary / Binary |
|---|---|---|
| + | Adds the two numbers on each side of the operator. | Binary |
| - | Takes the number to the left of the operator and subtracts the number to the right of the operator. | Binary |
| * | Multiplies the two numbers on both sides of the operator. | Binary |
| / | Takes the number to the left of the operator and divides it by the number to the right of the operator. | Binary |
| MOD | Takes the number to the left of the operator, divides it by the number to the right of the operator, and returns the remainder of the division. | Binary |
| - | Sign change. This unary operator changes the sign of the operand to its right. | Unary |
| NOT | Takes the number given as a parameter, considered as a 32-bit integer, and inverts all bits. Commonly known as "bitwise NOT". | Unary |
| AND | Takes the operands on both sides of the operator, considered as 32-bit integers, and performs a logical AND operation for each bit of both operands. Commonly known as "bitwise AND". | Binary |
| OR | Takes the operands on both sides of the operator, considered as 32-bit integers, and performs a logical OR operation for each bit of both operands. Commonly known as "bitwise OR". | Binary |
| XOR | Takes the operands on both sides of the operator, considered as 32-bit integers, and performs a logical XOR operation for each bit of both operands. Commonly known as "bitwise XOR". | Binary |