title: std::cout with floating number
body: <p>I'm using visual studio 2015 to print two floating numbers:</p>
  <pre><code>double d1 = 1.5;
  double d2 = 123456.789;
  
  std::cout &lt;&lt; &quot;value1: &quot; &lt;&lt; d1 &lt;&lt; std::endl;
  std::cout &lt;&lt; &quot;value2: &quot; &lt;&lt; d2 &lt;&lt; std::endl;
  
  std::cout &lt;&lt; &quot;maximum number of significant decimal digits (value1): &quot; &lt;&lt; -std::log10(std::nextafter(d1, std::numeric_limits&lt;double&gt;::max()) - d1) &lt;&lt; std::endl;
  std::cout &lt;&lt; &quot;maximum number of significant decimal digits (value2): &quot; &lt;&lt; -std::log10(std::nextafter(d2, std::numeric_limits&lt;double&gt;::max()) - d2) &lt;&lt; std::endl;
  </code></pre>
  <p>This prints the following:</p>
  <pre><code>value1: 1.5
  value2: 123457
  maximum number of significant decimal digits (value1): 15.6536
  maximum number of significant decimal digits (value2): 10.8371
  </code></pre>
  <p>Why <code>123457</code> is printed out for the value <code>123456.789</code>? Does ANSI C++ specification allow to display anything for floating numbers when <code>std::cout</code> is used without <code>std::setprecision()</code>?</p>