title: % (mod) explanation
body: <p>Today I was writing a program in C#, and I used <strong>%</strong> to calculate some index... My program didn't work, so I debugged it and I realized that "<strong>%</strong>" is not working like in other program languages that I know.</p>
  
  <p>For example:</p>
  
  <p>In Python <code>%</code> returns values like this:</p>
  
  <pre><code>for x in xrange (-5, 6):
       print x, "% 5 =", x % 5
  
  -5 % 5 = 0
  -4 % 5 = 1
  -3 % 5 = 2
  -2 % 5 = 3
  -1 % 5 = 4
  0 % 5 = 0
  1 % 5 = 1
  2 % 5 = 2
  3 % 5 = 3
  4 % 5 = 4
  5 % 5 = 0
  </code></pre>
  
  <p>In C#:</p>
  
  <pre><code>for (int i = -5; i &lt; 6; i++)
  {
      Console.WriteLine(i + " % 5 = " + i % 5);
  }
  
  -5 % 5 = 0
  -4 % 5 = -4
  -3 % 5 = -3
  -2 % 5 = -2
  -1 % 5 = -1
  0 % 5 = 0
  1 % 5 = 1
  2 % 5 = 2
  3 % 5 = 3
  4 % 5 = 4
  5 % 5 = 0
  </code></pre>
  
  <p>Did I do something wrong or is <code>%</code> not working like it should?</p>