Home
Products
Community
Manuals
Contact
Login or Signup

BlitzPlus Docs -> 2D - A-Z -> M -> Mod

Mod

Parameters:

None

Description:

Basically, this will divide your number as many times as possible by the divisor, then return you the remaining amount.

Example:

; MOD Example

; Divide 10 by 3 until you reach a point that you can't ; Then print the remaining  value - in this case, 1 Print 10 MOD 3
 

Comments

WolRon(Posted 1+ years ago)
The example is screwed. It should read:

; MOD Example

; Divide 10 by 3 until you reach a point that you can't 
; Then print the remaining  value - in this case, 1 
Print 10 MOD 3



Rob Farley(Posted 1+ years ago)
Something that needs to be said with mod aswell is that it makes for brilliant counters;
n = (n + 1) mod 100
Would give you a counter that goes from 0 to 99


BlitzPlus Manual Forum

Blitz3D Equivalent Command