From 2eb363cea53f07e518117bed25cf4e8ec3ca6a56 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 5 Aug 2014 17:33:12 +0800 Subject: [PATCH] Initialize sum_sq before using it or the standard deviation would be incorrect. --- LogHistogramSampler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LogHistogramSampler.h b/LogHistogramSampler.h index 759d7f3..e1a781c 100644 --- a/LogHistogramSampler.h +++ b/LogHistogramSampler.h @@ -23,7 +23,7 @@ public: double sum_sq; LogHistogramSampler() = delete; - LogHistogramSampler(int _bins) : sum(0.0) { + LogHistogramSampler(int _bins) : sum(0.0), sum_sq(0.0) { assert(_bins > 0); bins.resize(_bins + 1, 0);