MODV

MODV is a CAOS command for arithmetic.

Usage
Syntax: MODV var (int variable) x (int)

Sets var to the remainder of var when divided by x, otherwise known as var mod x. Equivalent to.

Both arguments must be integers. If x is not, it will be cast. If var is not, the command will fail.

Examples
Add the 24-hour format times va00 and va01, storing the result in va00. For instance, 0520 + 1240 = 1800, and 0940 + 1624 = 0204 SETV va02 va00 MODV va02 100 SETV va03 va01 MODV va03 100 ADDV va02 va03 SETV va04 va02 DIVV va04 60 MODV va02 60
 * first separate the minutes:
 * add minutes:
 * store the carry:
 * clock the minutes:

DIVV va00 100 DIVV va01 100 ADDV va00 va01 ADDV va00 va04 MODV va00 24
 * separate the hours (int division):
 * add them:
 * clock them:

MULV va00 100 ADDV va00 va02
 * recombine into 24-hour time:

An implementation of  using a loop. DOIF va00 ge va01 LOOP SUBV va00 va01 UNTL va00 lt va01 ENDI