title: Extract upper and lower word of an unsigned 32-bit integer
body: <p>To extract the upper and lower word of an unsigned 32-bit integer and store each one in separate uint16_t-variables I do as follows (<em>nbr</em> is an unsigned 32-bit integer):</p>
  
  <pre><code>uint16_t lower_word = (uint16_t) nbr &amp; 0x0000FFFF;  // mask desired word
  uint16_t upper_word = (uint16_t) ((nbr &amp; 0xFFFF0000) &gt;&gt; 16); // right-shift after masking
  </code></pre>
  
  <p>Is the explicit conversion to an uint16_t unnecessary? What other more effective ways, if there are any, do you recommend to obtain the desired results instead of this approach? </p>