$Mod

From m204wiki
Revision as of 14:02, 29 July 2014 by Mlarocca (talk | contribs) (Mlarocca moved page $MOD to $Mod)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The $MOD function returns the remainder that results when the first argument is divided by the second argument (the first argument modulo the second argument). Each argument is first rounded to an integer. $MOD (X,0) is defined to be X.

Example 1

$MOD (5,3)

equals 2.

Example 2

IF $MOD (Z,2) THEN PRINT 'ODD'

prints ODD only if the value of the field Z is odd.