title: Bit shifting an int 32 times in C
body: <p>I have a specific C bit-shifting scenario that I do not believe is covered on Stack Overflow yet.  (If it is, I haven't been able to find it!)</p>
  
  <p>This exercise is using <code>signed int</code>s as the data type.</p>
  
  <p>Take the value <code>0x80000000</code> (which is just a 1 in the most significant bit.)</p>
  
  <p>Shift it right once on a machine using arithmetic right-shifts (which mine does).</p>
  
  <p>Result = <code>0xC0000000</code> (1100 0000 in leftmost byte).</p>
  
  <p>Continue shifting it and you should be filling up with ones, from the left to the right.</p>
  
  <p>Result = <code>0xFFFFFFFF</code> (All ones.)</p>
  
  <p><strong>However:</strong>  Try the same example but shift one extra position, all together:</p>
  
  <p><code>0x80000000 &gt;&gt; 0x00000020</code> (Right shift 32 times)</p>
  
  <p>Your result?  I don't know.  My result was not all ones.  In fact, I got <code>0x00000001</code> which was NOT my desired behavior.  Why is this?  Is it machine specific?</p>
  
  <p><em>(Context: Homework assignment limiting my operations to a few bit operators to solve a puzzle.  This is an aspect to a puzzle but is far from the entire question.)</em></p>