Home / lang / mod 
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration   
fr  de  es  it  nl  pl  pt  pt_BR  mk  sq  ca  ar  fa  vi  ja  ru  zh  zh_TW  eo 
Documentation
History
 
MOD
Syntax
Remainder = Numerator AS Integer MOD Denominator AS Integer

Calculates the remainder of the quotient of two integer numbers.

This operator does not evaluate the true mathematic modulo:

A MOD B = A - (A DIV B) * B

Examples

PRINT 9 MOD 4, -9 MOD 4, 9 MOD -4, -9 MOD -4

1 -1 1 -1

' Example : To test divisibility by 5

DIM N AS Integer
N = 563

IF N MOD 5 = 0 THEN
PRINT "The number " & N & " is divisible by 5"
ELSE
PRINT "The number " & N & " is not divisible by 5"
ENDIF

The number 563 is not divisible by 5

See also

Arithmetic Operators  DIV