From 3025145f2b299ef8ece05bf58db65905376bcf6d Mon Sep 17 00:00:00 2001
From: Andrea Milluzzo <andrea.milluzzo@skywarder.eu>
Date: Fri, 24 Apr 2020 18:13:09 +0200
Subject: [PATCH] [stats.cpp] fixed bug where the wrong min value for float was
 used (maxValue)

---
 src/shared/math/Stats.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/shared/math/Stats.cpp b/src/shared/math/Stats.cpp
index 3b3567a71..43231d8f2 100644
--- a/src/shared/math/Stats.cpp
+++ b/src/shared/math/Stats.cpp
@@ -42,7 +42,7 @@ ostream& operator<<(ostream& os, const StatsResult& sr)
 
 Stats::Stats()
     : 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)
 void Stats::reset()
 {
     minValue = numeric_limits<float>::max();
-    maxValue = numeric_limits<float>::min();
+    maxValue = numeric_limits<float>::lowest();
     mean     = 0.f;
     m2       = 0.f;
     n        = 0;
-- 
GitLab