Due to the fact that uint32(5)/2 gives 3 for compatibility for matlab and the use of division in the mod.m file, mod(uint32(5),2) gives 0 when it should give 1. A simple patch is to replace x - y .* floor (x ./ y); with x - y .* floor (double(x) ./ y); at lines 57 and 70 in mod.m (version 3.0.1). Greg Buzzard