title: Function accepting two arguments, a byte and a bit field, and returns the value of the field in the byte
body: <p>I found some code online that performs this task:</p>
  
  <pre><code>byte = byte &gt;&gt; field;
  byte = byte &amp; 0x01;
  return(byte);
  </code></pre>
  
  <p>However, I don't understand why we can't just do this:</p>
  
  <pre><code>return(byte &amp; field);
  </code></pre>
  
  <p>Will this work?  Why or why not?  Are there better implementations?</p>