function y = mod(x,N)
%y = MOD(n, N)
%   Compute (x modulo N) for any x.
%
%   See also REM
   
y = rem( rem(x,N)+N, N );

