title: Difference Between Modulus Implementation in Python Vs Java
body: <p>I've noticed differing implementations of the modulus operator in Python and Java.</p>
  
  <p>For example, in Python:</p>
  
  <pre><code>&gt;&gt;&gt; print -300 % 800
  &gt;&gt;&gt; 500
  </code></pre>
  
  <p>Whereas in Java:</p>
  
  <pre><code>System.out.println(-300 % 800);
  -300
  </code></pre>
  
  <p>This caught me off guard, since I thought something as basic as modulus was universally interpreted the same way. I'm a fan of Python's interpretation (which I presume is borrowed from C), although I see the logic behind Java's implementation.</p>
  
  <p>Which do you typically prefer? Is there any specific reason for the differing interpretations? I have no intention of starting a language war, simply curious.</p>