title: Bitwise rotation (circular shift)
body: <p>I was trying to make some code in C++ about “bitwise rotation” and I would like to make this by the left shif. I didn’t know how to code this, but I found a little code in “Wikipedia” like this.</p>
  <pre><code>unsigned int rotl(unsigned int value, int shift) {
      return (value &lt;&lt; shift) | (value &gt;&gt; (sizeof(value) * CHAR_BIT - shift));
  }
  </code></pre>
  <p>Then I tried to make it work, but this code don’t give the output that I expected. Ex. I have the number <code>unsigned int 12</code>, in binary 1100, and when I want to do bitwise rotation by the left shif with the code above, the output is and <code>unsigned int 24</code>,( 11000), and it had to give the output <code>unsigned int 9</code>, because if I make the bitwise rotation(left shif), the first MSB bit have to be now the first bit, and all the others bits have to move one bit to left.</p>
  <p>Can you help to understand what is the problem of that ?, or if I am doing something wrong.</p>
  <p>Thank you.</p>