title: How to output IEEE-754 format integer as a float
body: <p>I have a unsigned long integer value which represents a float using IEEE-754 format. What is the quickest way of printing it out as a float in C++?</p>
  
  <p>I know one way, but am wondering if there is a convenient utility in C++ that would be better.</p>
  
  <p>Example of the way that I know is:</p>
  
  <pre><code>union
  {
      unsigned long ul;
      float f;
  } u;
  
  u.ul = 1084227584; // in HEX, this is 0x40A00000
  
  cout &lt;&lt; "float value is: " &lt;&lt; u.f &lt;&lt; endl;
  </code></pre>
  
  <p>(This prints out "float value is: 5" )</p>