title: How can I use bit shifting to replace integer division?
body: <p>I understand how to do it for powers of 2 so that's not my question.</p>
  
  <p>For example, if I want to find 5% of a number using a bit shift instead of an integer divide, how would i calculate that?</p>
  
  <p>So instead of (x * 20 / 19), I could do (x * 100 >> 11).  Now this isn't right but it's close and I arrived at it using trial and error. How would I determine the most possible precise shift to use?</p>