Skip to content

Commit 8cfa1d7

Browse files
GabrielNumworksHugoNumworks
authored andcommitted
[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.
1 parent 2702b77 commit 8cfa1d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/regression/store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ int Store::closestVerticalDot(int direction, double x, double y, int currentSeri
7878
}
7979

8080
int Store::nextDot(int series, int direction, int dot) {
81-
float nextX = INFINITY;
81+
double nextX = INFINITY;
8282
int selectedDot = -1;
8383
double meanX = meanOfColumn(series, 0);
84-
float x = meanX;
84+
double x = meanX;
8585
if (dot >= 0 && dot < numberOfPairsOfSeries(series)) {
8686
x = get(series, 0, dot);
8787
}

0 commit comments

Comments
 (0)