title: Float bitwise ops
body: <p>I want convert the storage of a floating point number to an integer (the 'number' value is not required to be equal).</p>
  
  <p>If a floating point number (eg 10), is represented in binary (at least on my implementation) as:</p>
  
  <pre><code>01000001001000000000000000000000
  </code></pre>
  
  <p>Then it should (also on my implementation) represent the integer value 1092616192.</p>
  
  <p>I am currently doing this through the following:</p>
  
  <pre><code>union UNFI {
      float a;
      int b;
  };
  
  UNFI n;
  n.a = 10;
  int bits = n.b; // foo!
  
  for (int i=31; i&gt;=0; --i) {
      bool bit = ((bits &gt;&gt; i) &amp; 1);
      std::cout &lt;&lt; bit;
  }
  </code></pre>
  
  <p>Which is achieving what I would like, but it is, in its nature, undefined behavior. Therefore I would like to know what the 'correct' way of achieving this outcome is.</p>
  
  <p>From the C99 standard:</p>
  
  <pre><code>With one exception, if the value of a member of a union object is used when the most recent store to the object was to a different member,the behavior is implementation-defined.
  </code></pre>
  
  <p>Is that not undefined behavior?</p>