 <p><code>v &amp;= -signed(v)</code> will clear all but the lowest set bit (<code>1</code>-bit) of v, i.e. extracts the least significant 1 bit from v (v will become a number with power of 2 afterwards). For example, for <code>v=14 (1110)</code>, after this, we have <code>v=2 (0010)</code>.</p> <p>Here, using <code>signed()</code> is because v is <code>unsigned</code> and you're trying to negate an <code>unsigned</code> value (gives compilation error with VS2012) (comment from JoelRondeau). Or you will get a warning like this: <em><code>warning C4146: unary minus operator applied to unsigned type, result still unsigned</code></em> (my test).</p>