title: Round down float using bit operations in C
body: <p>I am trying to round down a float using bit operations in C. 
  I start by converting the float to an unsigned int. 
  I think my strategy should be to get the exponent, and then zero out the bits after that, but I'm not sure how to code that. This is what I have so far: </p>
  
  <pre><code>float roundDown(float f);
  unsigned int notRounded = *(unsigned int *)&amp;f;
  unsigned int copy = notRounded;
  int exponent = (copy &gt;&gt; 23) &amp; 0xff;
  int fractional = 127 + 23 - exponent;
  if(fractional &gt; 0){
     //not sure how to zero out the bits. 
     //Also don't know how to deal with the signed part. 
  </code></pre>