folly: simplify the stats avgHelper() function
authorAdam Simpkins <simpkins@fb.com>
Wed, 22 Aug 2012 03:56:09 +0000 (20:56 -0700)
committerTudor Bosman <tudorb@fb.com>
Sun, 26 Aug 2012 18:13:55 +0000 (11:13 -0700)
commit6bdcff461de752870654a59baeafe1141104d760
tree6f2183901f2226d1ce2d386e32571bb13d896316
parent14223eae3f3cc0059f2d129ceec84b48506a6434
folly: simplify the stats avgHelper() function

Summary:
When the input type is a long double, perform division using long
double.  In all other cases, divide using double precision.

Also fix the EXPECT_EQ() usage in the test case.

Test Plan: fbconfig -r common/stats folly && fbmake runtests

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D555433
folly/detail/Stats.h
folly/test/TimeseriesTest.cpp