Skip to content

title: "mod" description: TRSE built-in method (from IDE help)


mod

Systems: X16,C64, MEGA65, PLUS4, C128, VIC20, NES, OK64, PET, ATARI2600, APPLEII, SNES, ORIC, BBCM, ACORN, ATARI800
Parameters: ib,b


Returns the modulo of parameter 1 with parameter 2.

Examples:

i:=mod(i+1,10); // is is kept between 0 and 9

k:=mod(k*2,j); // is is kept between 0 and j