Mod

From Free Pascal wiki
Revision as of 14:40, 21 November 2007 by Djzepi (talk | contribs) (New page: Mod ('''mod'''ulus) divides two numbers and returns only the remainder that is a whole number. For instance, the expression "a:= 13 mod 4;" would evaluate to 1 (a=1), while "b := 12 mod 4;...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Mod (modulus) divides two numbers and returns only the remainder that is a whole number. For instance, the expression "a:= 13 mod 4;" would evaluate to 1 (a=1), while "b := 12 mod 4;" would evaluate to 0 (b=0).


Result has the same sign as dividend. For example "c:= 13 mod 4;" then c=-2