Code center > Darwinbots Program Source Code
Confused
Ulciscor:
As I said, 4mod2 is the remainder when 4 is divided by 2. This is modulo. Modulus is the absoloute value, the magnitude of a number regardeless of sign. Mod is probably used most commonly as the first definition.
Old Henk:
So, for example:
4mod2 = 0 (4/2 is exactly 2; there's no remainder)
3mod2 = 1 (3/2 leaves one remainder)
10mod6 = 4
etc.
Numsgil:
Definition of mod:
a (mod n) = b means that:
n*q + b = a where b < n, b >= 0, and q is some integer.
That's the math definition anyway, I think computer mods allow for b to be < 0 (that is, just the remainder of integer division).
Navigation
[0] Message Index
[*] Previous page
Go to full version