title: Convert flag into either 0xFF or 0, based on whether flag equals 1 or 0
body: <p>I have a binary flag <code>f</code>, equal to either zero or one.
  If equal to one, I would like to convert to <code>0xFF</code>, otherwise, to 0.</p>
  
  <p>Current solution is  <code>f*0xFF</code>, but I would rather use bit twiddling to achieve this.</p>