Bitset membership function : <p>I'm writing a bitset membership predicate which should handle all values of x:</p>

<pre><code>int Contains(unsigned int A, int x)
{
    return (x &gt;= 0) &amp;&amp; (x &lt; 8 * sizeof A) &amp;&amp; (((1u &lt;&lt; x) &amp; A) != 0);
}
</code></pre>

<p>Is there a more efficient implementation?</p>
