An operator is a symbol or keyword indicating an arithmetic or logical operation that acts on one or more expressions. You also can use an operator to assign a value to a variable.
operator +
result = expression1 + expression2
Sums two variables. If both expressions are strings, the operator concatenates their contents. If one expression is a string and another one is numeric, the numeric expression will be converted to the equivalent string and concatenation performed.
expression1
|
expression2
|
result
|
integer
|
integer
|
integer
|
floating
|
floating
|
floating
|
string
|
string
|
string
|
integer
|
floating
|
floating
|
integer
|
string
|
string
|
floating
|
integer
|
floating
|
floating
|
string
|
string
|
string
|
integer
|
string
|
string
|
floating
|
string
|
operator -
result = expression1 - expression2
Finds the difference between two numbers.
expression1
|
expression2
|
result
|
integer
|
integer
|
integer
|
floating
|
floating
|
floating
|
string
|
string
|
floating
|
integer
|
floating
|
floating
|
integer
|
string
|
floating
|
floating
|
integer
|
floating
|
floating
|
string
|
floating
|
string
|
integer
|
floating
|
string
|
floating
|
floating
|
operator *
result = expression1 * expression2
Multiplies two numbers.
expression1
|
expression2
|
result
|
integer
|
integer
|
integer
|
floating
|
floating
|
floating
|
string
|
string
|
floating
|
integer
|
floating
|
floating
|
integer
|
string
|
floating
|
floating
|
integer
|
floating
|
floating
|
string
|
floating
|
string
|
integer
|
floating
|
string
|
floating
|
floating
|
operator /
result = expression1 / expression2
Divides two numbers.
expression1
|
expression2
|
result
|
integer
|
integer
|
floating
|
floating
|
floating
|
floating
|
string
|
string
|
floating
|
integer
|
floating
|
floating
|
integer
|
string
|
floating
|
floating
|
integer
|
floating
|
floating
|
string
|
floating
|
string
|
integer
|
floating
|
string
|
floating
|
floating
|
operator ^
result = expression1 ^ expression2
Raises expression1 to the power of an expression2.
The type of result is always floating.
operator mod
result = expression1 mod expression2
Divides the value of one expression by the value of another, and returns the remainder.
The type of result is always integer.
operator or
result = expression1 or expression2
Performs a logical disjunction on two expressions.
The type of result is always integer.
operator and
result = expression1 and expression2
Performs a logical conjunction on two expressions.
The type of result is always integer.
operator not
result = not expression
Performs logical negation on an expression.
The type of result is always integer.