Strange rounding of numbers when reading in from text file C++
<p>I have a text line containing only the following lines. </p>

<pre><code>0.01180994648909809 0.0118339243907452 0.01153905217670122

0.0376759911531237 0.03771224865527065 0.03765957194275842
</code></pre>

<p>I used the following code to read this data and output it to terminal</p>

<pre><code>using namespace std;

    int main(int argc, char *argv[])
    {

      ifstream infile(argv[1]);
      string line;
      double a,b,c;

      while(getline(infile,line))
      {
        istringstream iss(line);
        iss &gt;&gt; a &gt;&gt; b &gt;&gt; c;
        cout&lt;&lt;a&lt;&lt;"\t"&lt;&lt; b &lt;&lt; "\t"&lt;&lt;c&lt;&lt;endl;
       }

  return 0;}
</code></pre>

<p>The output I got was </p>

<pre><code>0.0118099   0.0118339   0.0115391
0.037676    0.0377122   0.0376596
</code></pre>

<p>Why is it that in the output the numbers have been rounded to 7 digits after the decimal? Is this rounding performed only while displaying to standard output? </p>
