title: value <= maximum
body: <p>I wonder, is it possible to achieve similar using bit operations:</p>
  
  <pre><code>if a &gt; maximum: a = maximum
  </code></pre>
  
  <p>Where 'maximum' can be a random number?</p>
  
  <p>Have many similar lines in my current code. Of course could have used:</p>
  
  <pre><code>def foo(a, max=512): return a if a&lt;max else max
  </code></pre>
  
  <p>Just curious if there's a more elegant and efficient way.</p>