Article ID: 130128
Article Last Modified on 2/9/2000
x MOD y = z where z + y * int(x/y) = x z = x - y * int(x/y)Therefore:
x MOD y = x - y * int(x/y)In the Microsoft MOD function, we do the same as above except we use the FLOOR() function instead of INT() in order to be backward compatible with other products that use the FLOOR() function.
**** MOD with FLOOR() ****
FUNCTION FLOORMOD
PARAMETER x,y
z = x - FLOOR(x/y)*y
RETURN z
**************************
**** MOD with INT() ******
FUNCTION INTMOD
PARAMETER x,y
z = x - INT(x/y)*y
RETURN z
**************************
Additional query words: VFoxWin
Keywords: kbcode KB130128