Skip to content

Do an Arithmetic Operation

This action takes two variables (that should contain integer values only) and performs an arithmetic operation (such as addition, subtraction…) with their values.

PropertyData TypeDescription
LeftVariableVarNameIndicates the name of the left variable: its value will be read and “put before” the operator. See below. May be directly an integer and not a variable name.
OperationTArithmOperatorTells the package which arithmetic operation it should execute. A list of possible operations to perform is available by pressing the Down button. See below.
ResultVarVarNameThe variable that will store the result of the operation. For example %MYRESULT%.
RightVariableVarNameIndicates the name of the right variable: its value will be read and “put after” the operator. See below. May be directly an integer and not a variable name.

The package will evaluate the operation like this: Left Variable Operator Right Variable

For example, consider the left variable %LEFT% set to “6”, the right variable %RIGHT% set to “4” and the operation is a multiplication: the resulting expression will be 6 x 4. The package will then store “24” in the ResultVar.

To simplify we will use %LEFT% and %RIGHT% to represent the values of the variables specified by LeftVariable and RightVariable.

NameDescriptionRequiredExample
cDoAbsoluteReturns an absolute valueOnly LeftVariable is used.If %LEFT% is set to “-4”, the result will be “4”.
cDoAdditionStandard additionTwo variables required.If %LEFT% is set to “8” and %RIGHT% to “4” the result will be 8+4 = “12”.
cDoIntDivision (div in Pascal)Integer division: this is the value of %LEFT% / %RIGHT% rounded in the direction of zero to the nearest integer.Two variables required. RightVariable should not be set to 0!If %LEFT% is set to “8” and %RIGHT% to “4” the result will be 8/4 = “2”.
cDoMultiplicationStandard multiplicationTwo variables required.If %LEFT% is set to “8” and %RIGHT% to “4” the result will be 8x4 = “32”.
cDoRemainder (mod in Pascal)Returns the remainder obtained by dividing its operands. In other words, x mod y = x - (x div y) * y.Two variables required.If %LEFT% is set to “8” and %RIGHT% to “3” the result will be 8 mod 3 = “2”.
cDoSubstractionStandard substractionTwo variables required.If %LEFT% is set to “2” and %RIGHT% to “3” the result will be 2-3 = “-1”.

You may also directly enter an integer as the value for LeftVariable and RightVariable without using a real variable. For example, you can directly enter “3” for RightVariable.