Mercurial > hg > svcore
changeset 1395:7e3532d56abb
Fix equality comparison that caused test case failure on 32-bit build
author | Chris Cannam |
---|---|
date | Tue, 28 Feb 2017 15:10:50 +0000 |
parents | 9ef1cc26024c |
children | 0bbf91b05164 |
files | base/LogRange.cpp |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/base/LogRange.cpp Tue Feb 28 14:04:16 2017 +0000 +++ b/base/LogRange.cpp Tue Feb 28 15:10:50 2017 +0000 @@ -23,6 +23,8 @@ void LogRange::mapRange(double &min, double &max, double logthresh) { + static double eps = 1e-10; + // ensure that max > min: if (min > max) std::swap(min, max); if (max == min) max = min + 1; @@ -55,7 +57,7 @@ min = std::min(logthresh, max); } - if (min == max) min = max - 1; + if (fabs(max - min) < eps) min = max - 1; } double