title: Working with bitmask in C and rewrite it into Python 3.6
body: <p>I have a simple code in C-language:</p>
  <pre><code>/* Bad if it's missing any of the &quot;good&quot; bits */
  if ( (f &amp; det-&gt;mask_good)
         != det-&gt;mask_good ) {...};
  
  /* Bad if it has any of the &quot;bad&quot; bits. */
  if ( f &amp; det-&gt;mask_bad ) {...};
  </code></pre>
  <p>where f is a constant like &quot;0xfeff&quot;.</p>
  <p>I have to use the same condition in Python 3.6 and I did the following:</p>
  <pre><code>bitwise_bad = np.bitwise_and(MaskData[i,], f)
  
  
  condition_good = bitwise_bad != MaskData[i,]
  condition_bad = bitwise_bad
  
  join_condition = np.logical_or(condition_good, condition_bad)
  </code></pre>
  <p>I don't have any problem with code, but I am not sure that I rewrite these lines correctrly, because I am not familiar with C-language at all.</p>
  <p>I'll be very thankful if you say where I am wrong.</p>