Mathematical Operators
SenseTalk provides a number of mathematical operators. They are outlined below.
+
, Plus
Operators
Behavior: Adds two numbers or lists of numbers.
Syntax:
operand1 + operand2
operand1 plus operand2
Example:
put 12 + 97 into someSum
Example:
put a squared plus b squared into sumOfSquares
Example:
put [12,8] + [4,7] into vectorSum
-
, Minus
Operators
Behavior: Subtracts one number or list of numbers from another. Subtracting one date/time from another will give the difference as a time interval, measured in seconds.
Syntax:
operand1 - operand2
operand1 minus operand2
Example:
put c^2 - sumOfSquares into difference
Example:
put (1,3,5,6) - (1,1,0,2) into diffList