title: When taking modulo of negative numbers makes sense?
body: <p>I'm curious because we found a bug in our code written 2 years ago. We initialized a 16 bit signed integer with 0x8000 (the platform is of course uses 2's complement representation for negative numbers). In a hardly reproducible special case, modulo by 10 was being performed on this variable to extract individual digits in decimal representation while the value is still 0x8000 (-32768). -32768 % 10 == 248 which makes no sense for our application.</p>
  
  <p>Our platform is OKI 411 micro-controller.</p>
  
  <p>I'm curious, though taking modulo of negative number in this case makes no sense, is there any real life example or practical reason or to get benefit somehow by taking modulo of negative number?</p>