title: Dump hex float in C++
body: <p>I tried following:</p>
  
  <pre><code>std::cout &lt;&lt; std::hex &lt;&lt; 17.0625;
  </code></pre>
  
  <p>But it dumped it in decimal. I'd like to see 11.01 (17.0625 in hex). How can I print some floating point value in hex? </p>
  
  <p>Please do not offer solutions like:</p>
  
  <pre><code>void outhexdigits(std::ostream&amp; out, fp_t d, int max_chars=160)
  {
      while(d &gt; 0. &amp;&amp; max_chars)
      {
          while(d &lt; 1. &amp;&amp; max_chars){
              out &lt;&lt; '0';
              --max_chars;
              d*=16;
          }
  
          if (d&gt;=1. &amp;&amp; max_chars) {
              int i = 0;
              while (d&gt;=1.)
                  ++i, --d;
              out &lt;&lt; std::hex &lt;&lt; i;
              --max_chars;
          }
      }
  }
  </code></pre>
  
  <p>Is there any way to dump float numbers in hex in STL/boost? </p>