Updated: 1/18/2022, 5:31:44 PM
Created: 1/18/2022, 5:31:44 PM
Last Updated By: dependabot[bot]
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