title: Number of precision digits for double in C++ different in windows and Linux. Why? Linux shows more than 20 non-zero precision digits
body: <p>Just did this:</p>
  
  <pre><code>double val1=numeric_limits&lt;double&gt;::max();
  cout.precision(70);
  cout&lt;&lt;"\nVal1: "&lt;&lt;val1;
  </code></pre>
  
  <p>In Windows I start getting 0s after 17 digits(16 digits after decimal point). However in Linux, as I keep increasing the cout.precision(NUMBER), more and more digits keep showing and they are not zeros. </p>
  
  <p>Also, running the following code shows '15' on both Windows and Linux. Windows system is 32 bits and Linux one is 64 bit if that makes any difference.</p>
  
  <pre><code>typedef std::numeric_limits&lt; double &gt; dl;
  cout &lt;&lt; "\tdigits (decimal):\t" &lt;&lt; dl::digits10 &lt;&lt; endl;
  </code></pre>
  
  <p>Can any one help with an explanation as to what is going on here?
  I thought number of precision digits will be same in Windows &amp; Linux since sizeof(double) is 8 on both of them. </p>