mathematical operators
Syntax
<firstOperand> + <secondOperand>
<firstOperand> - <secondOperand>
<firstOperand> * <secondOperand>
<firstOperand> / <secondOperand>
<firstOperand> ^ <secondOperand>
put 14 + 32 into myFavoriteNumber
put number of buttons / 5 into gridRowLength
put 2 ^ 16 into twoToTheSixteenth
Explanation
SuperCard supports 5 standard mathematical operators:
+
adds the number firstOperand to the number secondOperand. (E.g.15 + 5
=20
)-
subtracts the number secondOperand from the number firstOperand. (E.g.15 - 5
=10
)*
Multiplies the number firstOperand with the number secondOperand. (E.g.2 * 3
=6
)/
Divides the number firstOperand by the number secondOperand. Raises an error and exits to top if secondOperand is 0. (E.g.10 / 2
=5
)^
Raises the number firstOperand to the power of secondOperand. (E.g.3 ^ 3
=3 * 3 * 3
=27
)