[Boost-bugs] [Boost C++ Libraries] #8262: numeric::average gives incorrect result

Subject: [Boost-bugs] [Boost C++ Libraries] #8262: numeric::average gives incorrect result
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-07 19:40:42


#8262: numeric::average gives incorrect result
---------------------------------------+------------------------------------
 Reporter: james.hirschorn@… | Owner: eric_niebler
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: accumulator
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: average |
---------------------------------------+------------------------------------
 Apparently boost::numeric::average was incorrectly implemented as
 numeric::divides.

 The following code, computes average(2, 3) = 0.666667:


 {{{
 #include <iostream>
 #include <boost/accumulators/numeric/functional.hpp>

 int main(int argc, char * argv[])
 {
     using namespace boost::numeric;

     auto avg = average(2, 3);

     std::cout << avg << std::endl;
 }

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8262>
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:12 UTC