Why does 2 mod 4 = 2?
I'm embarrassed to ask such a simple question. My term does not start for two more weeks so I can't ask a professor, and the suspense would kill me. Why does 2 mod 4 = 2? Jarsen Mod just means you take the remainder after performing the division. Since 4 goes into 2 zero times, you end up with a remainder of 2. Modulo is the remainder, not division. 2 / 4 = 0R2 2 % 4 = 2 The sign % is often used for the modulo operator, in lieu of the word mod . For x % 4 , you get the following table (for 1-10) x x%4 ------ 1 1 2 2 3 3 4 0 5 1 6 2 7 3 8 0 9 1 10 2 Modulo (mod, %) is the Remainder operator. 2