From 8cfa1d7e4f98e0d1ad7cf254e881a4e664d0c503 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 28 Jan 2021 18:20:32 +0100 Subject: [PATCH] [regression/store] Avoid conversion from double to float The value of variable meanX was computed in double, but then stored in another variable x of type float, thus causing a conversion with potentially a change of value, and then some incorrect comparisons. --- apps/regression/store.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/regression/store.cpp b/apps/regression/store.cpp index e081924f586..5b054939164 100644 --- a/apps/regression/store.cpp +++ b/apps/regression/store.cpp @@ -78,10 +78,10 @@ int Store::closestVerticalDot(int direction, double x, double y, int currentSeri } int Store::nextDot(int series, int direction, int dot) { - float nextX = INFINITY; + double nextX = INFINITY; int selectedDot = -1; double meanX = meanOfColumn(series, 0); - float x = meanX; + double x = meanX; if (dot >= 0 && dot < numberOfPairsOfSeries(series)) { x = get(series, 0, dot); }