>OK, perhaps just a mention that the return when negative numbers are used will not be what you expect. By the way, is VB incorrect when it returns -1 or have they redefined the meaning of MOD to mean just the remainder when you divide by both negative and positive numbers?
>
>The definition in the VFP help file reads 'Divides one numeric expression by another numeric expression and returns the remainder.' I am not a math guy so I just believed the definition given and, therefore, I would expect MOD(-13,4) to return -1.
VB is not incorrect. It's their definition (as well as say C#'s). It's remainder as it says in C#, VFP doc lies IMHO:)
Cetin