title: C++ fast division/mod by 10^x
body: <p>In my program I use a lot of integer division by 10^x and integer mod function of power 10.</p>
  
  <p>For example:</p>
  
  <pre><code>unsigned __int64 a = 12345;
  a = a / 100;
  ....
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>unsigned __int64 a = 12345;
  a = a % 1000;
  ....
  </code></pre>
  
  <p>If I am going to use the right bit shift <code>&gt;&gt;</code>, then I will get mode of <code>2^x</code>, which is not what I want.</p>
  
  <p>Is there any way I can speed up my program in integer division and mod functions?</p>