Python 2.2: How to get the lower 32 bits out of a 64 bit number?
<p>I have a 64 bit number comprised of various bit fields and I'm writing a simple python utility to parse the number.  The problem I'm facing is that the lower 32 bits comprise of one field and using some combination of bit shifts or bit masking doesn't give just the 32 bits.  </p>

<pre><code>big_num = 0xFFFFFFFFFFFFFFFF
some_field = (big_num &amp; 0x00FFFF0000000000) # works as expected
field_i_need = big_num &amp; 0x00000000FFFFFFFF # doesn't work
</code></pre>

<p>What happens is that <code>field_i_need</code> is equal to <code>big_num</code>, not the lower 32 bits.</p>

<p>Am I missing something simple here?</p>

<p>Thanks!</p>

<p>Matthew</p>
