AMOSi:Mod

From Amiga Coding
Revision as of 01:51, 17 November 2007 by Spellcoder (talk | contribs) (1 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MOD is a useful little function which allows you to cycle a variable through a repetitive series of values. It works by returning the remainder after a division.


r=v Mod d

This is equivalent to:


R=v - Int(v/d)*d