If you need a proper mod function in Blockland that works better than the normal % operator, use this:
function mod(%a, %b) {
%result = %a - %b * mFloor(%a / %b);
if (%a < 0) {
return %b + %result;
}
return %result;
}
Works for mod(n, n), mod(-n, n), mod(n, -n) and mod(-n, -n).
The % operator only works for n % n.