- Contents
Interaction Designer Help
Mathematical Operators
The following operators perform math operations.
? + ?
(Numeric or Integer) + (Numeric or Integer)
Adds two numbers of the same type (Integer or Numeric). The result of this operation is a value of the same type as the numbers added.
Example: 1+1 results in a value of 2.
? - ?
(Numeric or Integer) - (Numeric or Integer)
Subtracts the value on the right from the value on the left. The two numbers must be of the same type (Integer or Numeric). The result of this operation is a value of the same type as the numbers subtracted.
Example: 2-1 results in a value of 1.
? * ?
(Numeric or Integer) * (Numeric or Integer)
Multiplies two numbers of the same type (Integer or Numeric). The result of this operation is a value of the same type as the numbers multiplied.
Example: 4*3 results in a value of 12.
? / ?
(Numeric or Integer) / (Numeric or Integer)
Divides the value on the right into the value on the left. The two numbers must be of the same type (Integer or Numeric). The result of this operation is a value of the same type as the numbers subtracted.
Example: 16/8 results in a value of 2.
? ^ ?
(Numeric or Integer) ^ (Numeric or Integer)
Raises the value of a Numeric or Integer to the power of a Numeric or Integer.
Example: 2 ^ 3 results in a value of 8.
Abs
Abs (Integer)
Returns the absolute value of an Integer.
Example: Abs(3-4) results in a value of 1.
Mod
Mod (Integer, Integer)
Returns the remainder after dividing the right integer into the left integer.
Example: Mod (5,2) results in a value of 1 because 2 goes in 5 twice with a remainder of one.
- ?
- (Numeric or Integer)
Multiplies a value by negative one. In other words, converts a positive number to a negative number, and converts a negative number to a positive number.
Example: -(-5) results in a value of 5. -(14) results in a value of -14.