 <p>I get that same result. But, if I inject a <code>setprecision</code>, I get the right value:</p> <pre><code>#include &lt;iostream&gt; #include &lt;iomanip&gt; #include &lt;cmath&gt; int main (void) { double x=2147483647.0; double y=sqrt(x); std::cout &lt;&lt; std::setprecision(10) &lt;&lt; y &lt;&lt; std::endl; return 0; } </code></pre> <p>gives me:</p> <pre><code>46340.95 </code></pre> <p>In fact, if you use the folowing code:</p> <pre><code>#include &lt;iostream&gt; #include &lt;iomanip&gt; #include &lt;cmath&gt; int main (void) { double x=2147483647.0; double y=sqrt(x); std::cout &lt;&lt; y &lt;&lt; std::endl; std::cout &lt;&lt; std::setprecision(0) &lt;&lt; std::fixed &lt;&lt; y &lt;&lt; std::endl; std::cout &lt;&lt; std::setprecision(1) &lt;&lt; std::fixed &lt;&lt; y &lt;&lt; std::endl; std::cout &lt;&lt; std::setprecision(2) &lt;&lt; std::fixed &lt;&lt; y &lt;&lt; std::endl; std::cout &lt;&lt; std::setprecision(3) &lt;&lt; std::fixed &lt;&lt; y &lt;&lt; std::endl; return 0; } </code></pre> <p>you get:</p> <pre><code>46341 46341 46341.0 46340.95 46340.950 </code></pre> <p>So it appears that the default setting (at least for my environment) is a precision of zero.</p> <p>If you <em>want</em> a specific format, I suggest you explicitly request it.</p>