Action: Mod(variable, A, B)

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

mod(variable, A, B)

First defined in: FKiSS3
The mod action sets the value of variable to the value of (A modulo B).
Modulo means "divide these numbers and take the remainder". (5 modulo 2) = 1
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:

;@ mod(X, X, 2)         ; Divide X by 2 and store the remainder back in X.
;@ mod(Remainder, A, B) ; Divide A by B and store the remainder in Remainder.