Skip to content
Snippets Groups Projects
Commit 3025145f authored by Andrea Milluzzo's avatar Andrea Milluzzo
Browse files

[stats.cpp] fixed bug where the wrong min value for float was used (maxValue)

parent ce4795e6
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ ostream& operator<<(ostream& os, const StatsResult& sr) ...@@ -42,7 +42,7 @@ ostream& operator<<(ostream& os, const StatsResult& sr)
Stats::Stats() Stats::Stats()
: minValue(numeric_limits<float>::max()), : minValue(numeric_limits<float>::max()),
maxValue(numeric_limits<float>::min()), mean(0.f), m2(0.f), n(0) maxValue(numeric_limits<float>::lowest()), mean(0.f), m2(0.f), n(0)
{ {
} }
...@@ -64,7 +64,7 @@ void Stats::add(float data) ...@@ -64,7 +64,7 @@ void Stats::add(float data)
void Stats::reset() void Stats::reset()
{ {
minValue = numeric_limits<float>::max(); minValue = numeric_limits<float>::max();
maxValue = numeric_limits<float>::min(); maxValue = numeric_limits<float>::lowest();
mean = 0.f; mean = 0.f;
m2 = 0.f; m2 = 0.f;
n = 0; n = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment