Mod

From NSB App Studio
Revision as of 17:50, 8 July 2012 by Brendon (talk | contribs) (Created page with "''result'' = ''x'' MOD ''y'' '''Description''' MOD divides ''x'' by ''y'' and returns the integer part of the remainder. The required parameters, ''x'' and ''y'', are any va...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

result = x MOD y

Description

MOD divides x by y and returns the integer part of the remainder. The required parameters, x and y, are any valid numeric expressions. The value of result is a whole number with a magnitude less than the magnitude of y.

Example

REM MOD Example
'MOD returns quotient remainder as integer
DIM Answer
Answer = 15 MOD 2
PRINT "15 MOD 2 = " & Answer
Answer = 21 MOD 3.7
PRINT "21 MOD 3.7 = " & Answer

Output

15 MOD 2 = 1
21 MOD 3.7 = 1