Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)
Tags: mod rem mathematical operations
The MOD or REM functions return the arithmetic modulo of two numeric expressions. They take the general form:
Where both expression1 and expression2 should evaluate to numeric expressions or a runtime error will occur.
The remainder of expression1 divided by expression2 calculates the modulo. If expression2 evaluates to 0, then the value of expression1 is returned.
An example of use is as below:
FOR inx = 1 TO 10000 IF MOD (inx, 1000) = 0 THEN *perform a task END NEXT inx
Go back to jBASE BASIC
Go back to Programmers' Reference Guide