last 5 bits of a bitmask
<p>I have a bitmask (stored as a short). For various purposes, I want to zero out all but the last 5 bits - I'm sure there is an easy to way to do this via bitwise operators, but it eludes me.</p>

<pre><code>1010 01101 1011 0111 -&gt; 0000 0000 0001 0111
</code></pre>

<p>Thanks</p>
