Boost C++ Libraries: Ticket #7402: Typo in math example https://svn.boost.org/trac10/ticket/7402 <p> In the function <code>two_samples_t_test_equal_sd</code> in libs/math/example/students_t_two_samples.cpp: </p> <pre class="wiki"> // // Now we can calculate and output some stats: // // Degrees of freedom: double v = Sn1 + Sn2 - 2; cout &lt;&lt; setw(55) &lt;&lt; left &lt;&lt; "Degrees of Freedom" &lt;&lt; "= " &lt;&lt; v &lt;&lt; "\n"; // Pooled variance: double sp = sqrt(((Sn1-1) * Sd1 * Sd1 + (Sn2-1) * Sd2 * Sd2) / v); /********* THIS LINE BELOW **********/ cout &lt;&lt; setw(55) &lt;&lt; left &lt;&lt; "Pooled Standard Deviation" &lt;&lt; "= " &lt;&lt; v &lt;&lt; "\n"; // t-statistic: double t_stat = (Sm1 - Sm2) / (sp * sqrt(1.0 / Sn1 + 1.0 / Sn2)); cout &lt;&lt; setw(55) &lt;&lt; left &lt;&lt; "T Statistic" &lt;&lt; "= " &lt;&lt; t_stat &lt;&lt; "\n"; </pre><p> I believe the line marked should have <code>sp</code> in place of <code>v</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7402 Trac 1.4.3 John Maddock Fri, 21 Sep 2012 16:09:42 GMT owner changed https://svn.boost.org/trac10/ticket/7402#comment:1 https://svn.boost.org/trac10/ticket/7402#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Paul A. Bristow</span> </li> </ul> Ticket Paul A. Bristow Wed, 26 Sep 2012 15:36:35 GMT status changed; keywords, resolution set https://svn.boost.org/trac10/ticket/7402#comment:2 https://svn.boost.org/trac10/ticket/7402#comment:2 <ul> <li><strong>keywords</strong> math students t two sample added </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks for reporting this. Glad to see someone is reading this. </p> <p> Corrected in trunk SVN 80706 </p> Ticket