Skip to main content
CloudStudio

Arithmetic operators

Arithmetic operators

Arithmetic operators are applied in mathematical operations, and the result of their application is always a number.

OperatorExplanationUnary / 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
MODTakes 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
NOTTakes the number given as a parameter, considered as a 32-bit integer, and inverts all bits. Commonly known as "bitwise NOT".Unary
ANDTakes 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
ORTakes 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
XORTakes 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

Last updated on

On this page