a % b is identical to mod
You can use % to round a decimal number down to the nearest whole number. For example: If you wanted to use the command random to generate a whole number between 0 and 5, you could put this in a script:
In A1, the new commands round, floor or ceil would be the easier way to round.
SilentSpike
Be careful when dealing with negative numbers. The way a modulo operation treats negatives differs between languages. In SQF truncated division is used, hence: