title: Is there a difference between (n - (~r % n) - 1) and (n - (abs(r) % n)) when r < 0?
body: <p>I've been studying the <code>rotate</code> algorithm, and came across a formula to normalize a negative number of rotations: <code>n - (~r % n) - 1</code>. </p>
  
  <p>I've been wondering how that's different to <code>n - (abs(r) % n)</code> or even <code>n - (-r % n)</code>. Does the <code>NOT</code> do anything special that a basic <code>abs</code> doesn't? Or just for performance? </p>