stats: fix the distribution stat
authorNathan Binkert <nate@binkert.org>
Mon, 10 Jan 2011 19:11:16 +0000 (11:11 -0800)
committerNathan Binkert <nate@binkert.org>
Mon, 10 Jan 2011 19:11:16 +0000 (11:11 -0800)
src/base/statistics.hh

index 9c10164a9c228b32247556661202e349c95812b1..529871dc4f6ece4cd1754fe156c570f6dabc5220 100644 (file)
@@ -1361,9 +1361,8 @@ class DistStor
         if (val > max_val)
             max_val = val;
 
-        Counter sample = val * number;
-        sum += sample;
-        squares += sample * sample;
+        sum += val * number;
+        squares += val * val * number;
         samples += number;
     }