Operators
Overview
Math Operators
Operator
Meaning
Examples
REM Assign $FOO to 42
VAR $FOO = 42
REM The variable is now 42.
REM Let's add it by 1.
$FOO = ( $FOO + 1 )
REM The variable is now 43: the sum of 42 and 1.
REM Let's subtract it by 1.
$FOO = ( $FOO - 1 )
REM The variable is now 42 (again): the difference of 42 and 1.
REM Let's multiply it by 2.
$FOO = ( $FOO * 2 )
REM The variable is now 84: the product of 42 and 2.
REM Let's divide it by 2.
$FOO = ( $FOO / 2 )
REM The variable is now 42 (again): the quotient of 82 and 2.
REM Let's modulus it by 4.
$FOO = ( $FOO % 4 )
REM The variable is now 2: the signed remainder of 42 and 4.
REM Let's raise it to the power of 6.
$FOO = ( $FOO ^ 6 )
REM Our variable is now 64: the exponent of 2 and 6.Comparison Operators
Operator
Meaning
Examples
Order of Operations
Logical Operators
Operator
Description
Examples
Augmented Assignment Operators
Example
Result
Bitwise Operators
Operator
Description
Example
Result
Last updated