title: Clearing least significant bit
body: <h1>Question</h1>
  
  <p>How would I change the least significant bit to 0 without affecting the rest of the value, for example: <code>0xffffffff</code> , for example in C or Python? I am not a mathematical genius, so for me it's a hassle to find out how to achieve this.</p>
  
  <h1>Solution</h1>
  
  <pre><code>n = 0 // clear this bit
  0xffffffff &amp;= ~(1U &lt;&lt; n) = 0xfffffffe
  </code></pre>