title: negate floating number in c fails in some cases
body: <p>I wrote a function which works for hundreds of cases but fails in some cases.</p>
  
  <p>Here is the C function:</p>
  
  <pre><code>unsigned negate_number(unsigned x) {
    int sign = (!(x &amp; 0x80000000))&lt;&lt;31;
    int other = 0x7FFFFFFF &amp; x;
    return (sign | other);
  }
  </code></pre>
  
  <p>I am just masking sign, inverting it and doing a OR (joining) with masked exponent and mantessa. So this should work in all cases.</p>
  
  <p>But here is a case where it fails:
  x = 0x7fc00000 (2143289344)</p>