title: Javascript Modular Arithmetic
body: <p>Javascript evaluates the following code snippet to -1.</p>
  
  <pre>
  -5 % 4
  </pre>
  
  <p>I understand that the remainder theorem states a = bq + r such that 0 &le; r &lt; b.
  Given the definition above should the answer not be 3? Why does JavaScript return -1?</p>