Mod

From Lazarus-ccr

Jump to: navigation, 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