From d86d270f3e9f3598b818aa9644a5b8ce752fe451 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 29 May 2019 10:49:59 +0100 Subject: [PATCH] Fix float value comparisons, only consider values equal if both are NaN --- util/test/rdtest/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/test/rdtest/util.py b/util/test/rdtest/util.py index 2a42d1ca8..368eb5dfa 100644 --- a/util/test/rdtest/util.py +++ b/util/test/rdtest/util.py @@ -246,7 +246,7 @@ def value_compare(ref, data): return False # Special handling for NaNs - if math.isnan(ref) == math.isnan(data): + if math.isnan(ref) and math.isnan(data): return True # Floats are equal if the absolute difference is less than epsilon times the largest.