Binary Arithmetic Operators

InstallShield 2020 ยป InstallScript Language Reference

The InstallScript compiler recognizes the binary arithmetic operators listed in the following table.

Binary Arithmetic Operators

Symbol

Operation

Example

Description

+

Addition

x + y

Adds two operands.

-

Subtraction

x - y

Subtracts the second operand from the first operand.

*

Multiplication

x * y

Multiplies two operands.

/

Division

x / y

Divides the first operand by the second operand.

Because InstallShield does not have floating-point data types, the fractional part of the answer is dropped. For example, 5/2 = 2.5 --> 2.

%

Modulus

19 % 5

Divides the first operand by the second operand and returns the remainder. For example, nResult = 19 % 5; results in nResult = 4.

Tip:You should include a space both before and after an arithmetic operator to make your script more readable and to maintain a consistent appearance.

See Also