Action: Div(variable, A, B)

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

div(variable, A, B)

First defined in: FKiSS3
The div action sets the value of variable to the value of (A / B).
Since FKiSS uses integer-based math, the remainder is discarded. (5 / 2) = 2 and not 2.5.
If B is zero, 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:

;@ div(X, X, 2)        ; Divide the value of X by 2 and store the result back in X.
;@ div(Quotient, A, B) ; Divide A by B and store the result in Quotient.