Fix float value comparisons, only consider values equal if both are NaN

This commit is contained in:
baldurk
2019-05-29 10:49:59 +01:00
parent cf4ddc3434
commit d86d270f3e
+1 -1
View File
@@ -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.