title: Exact binary representation of a double
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2746380/float-to-binary-in-c">Float to binary in C++</a>  </p>
  </blockquote>
  
  
  
  <p>I have a very small double var, and when I print it I get -0. (using C++).
  Now in order to get better precision I tried using </p>
  
  <pre><code>cout.precision(18); \\i think 18 is the max precision i can get.
  cout.setf(ios::fixed,ios::floatfield);
  cout&lt;&lt;var;\\var is a double.
  </code></pre>
  
  <p>but it just writes -0.00000000000...</p>
  
  <p>I want to see the exact binary representation of the var.</p>
  
  <p>In other words I want to see what binary number is written in the stack memory/register for this var.</p>