Action: Sub(variable, A, B)

Related Actions: let, add, mul, div, mod, random
Related Events:overflow
See also: FKiSS, Events, Actions

sub(variable, A, B)

First defined in: FKiSS3
The sub action sets the value of variable to the value of (A - B).
If the result would be outside the range of a 32-bit integer (from -2147483648 to 2147483647), this action will trigger the Overflow event.

variable

variable must a variable name.

A

A may be number or a variable.

B

B may be number or a variable.

Example:

;@ sub(X, X, 1)    ; Subtract 1 from X and store the result back in X.
;@ sub(Diff, A, B) ; Subtract B from A and store the result in Diff.