MOD(x,y) calculates Modules Y from X z = x - y * floor(x/y); e = eps * floor(x/y); [z,e] = MOD(X,Y) z is the modulus of Y for X e is the error tolerance, for checking the accuracy z(e > abs(y)) is not defined z has always the same sign than y see also: REM