title: C++ Double values precision during file output
body: <p>I have the following code in c++</p>
  
  <pre><code>ofstream myfile;
      myfile.open ("promise.txt");
  
      for( int rating=lowerLimit; rating&lt;=upperLimit; rating++ )
      {
          promise = promisePVTable-&gt;getPromise(durationTable, rating, duration);
  
          myfile &lt;&lt; "Promise  " &lt;&lt; rating &lt;&lt; " : " &lt;&lt; promise &lt;&lt; "\n";
          hurdle = rc_min(1, (promise - 1) / promise);
  
          hurdles.push_back(hurdle);
      }
  </code></pre>
  
  <p>Every time i output the value of promise it truncates the value to 4 or 5 decimals in the output thought the actual value is 16 digits in decimals.How can i change the precision of double value during file output.</p>
  
  <p>Thanks</p>