>The mod command gives stange results when done this way:
>Mod(-13,4). I would expect this to return either 1 or -1 but it returns 3.
>Visual Basic return -1 for this command but Ruby return the same thing as VFP. Can someone explain this to me.... Thanks.
Calvin,
The implementaion of mod(x, y ) is
x mod y = x - y × floor(x/y)
x = -13
y = 4
? floor(x/y)
? x - y * floor(x/y)
see on this page
http://fixedreference.org/en/20040424/wikipedia/Modular_arithmetic
Gregory