[Boost-bugs] [Boost C++ Libraries] #7402: Typo in math example

Subject: [Boost-bugs] [Boost C++ Libraries] #7402: Typo in math example
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-21 15:03:39


#7402: Typo in math example
----------------------------------+-----------------------------------------
 Reporter: n.g.davies@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: math
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
 In the function {{{two_samples_t_test_equal_sd}}} in
 libs/math/example/students_t_two_samples.cpp:

 {{{
    //
    // Now we can calculate and output some stats:
    //
    // Degrees of freedom:
    double v = Sn1 + Sn2 - 2;
    cout << setw(55) << left << "Degrees of Freedom" << "= " << v << "\n";
    // Pooled variance:
    double sp = sqrt(((Sn1-1) * Sd1 * Sd1 + (Sn2-1) * Sd2 * Sd2) / v);
 /********* THIS LINE BELOW **********/
    cout << setw(55) << left << "Pooled Standard Deviation" << "= " << v
 << "\n";
    // t-statistic:
    double t_stat = (Sm1 - Sm2) / (sp * sqrt(1.0 / Sn1 + 1.0 / Sn2));
    cout << setw(55) << left << "T Statistic" << "= " << t_stat << "\n";
 }}}

 I believe the line marked should have {{{sp}}} in place of {{{v}}}.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7402>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC