Difference between revisions of "MOD"

From QB64 Wiki
Jump to navigation Jump to search
(Created page with ''''MOD''' is Integer remainder division. Also called Modulus. ''Syntax:'' Numerator MOD Divisor MOD returns 0 if a number is evenly divisible by Integer division (\). MOD retur…')
 
Line 4: Line 4:
  
 
MOD returns 0 if a number is evenly divisible by Integer division (\).
 
MOD returns 0 if a number is evenly divisible by Integer division (\).
 +
 
MOD returns 0 if the numerator is 0. The divisor should never be 0!
 
MOD returns 0 if the numerator is 0. The divisor should never be 0!
  
 
''Example:'' a% = 100 MOD 9
 
''Example:'' a% = 100 MOD 9
:''Result:'' a% = 1
+
''Result:'' a% = 1

Revision as of 05:10, 28 August 2009

MOD is Integer remainder division. Also called Modulus.

Syntax: Numerator MOD Divisor

MOD returns 0 if a number is evenly divisible by Integer division (\).

MOD returns 0 if the numerator is 0. The divisor should never be 0!

Example: a% = 100 MOD 9 Result: a% = 1