modchad.m (117B)
1 function y = mod(x, a) 2 3 % return the mod of x to a 4 % eg mod(4, 4) = 0, mod(5, 4) = 1; 5 6 n = floor(x/a); 7 y = x - n*a;