From 79d5a411824510c13012b28d636d4af4790a4efa Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 24 Nov 2014 14:20:25 +0100 Subject: In our floating point comparison 0.0 should be equal to 0.0 We when comparing floating points we do a relative comparison of the difference. This fails when both numbers are (exactly) 0.0 which happens to occur when plotting an O2 graph without o2 data resulting in both min and max for the y-axis to be 0. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- dive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dive.h') diff --git a/dive.h b/dive.h index 0be834851..0ddc43f02 100644 --- a/dive.h +++ b/dive.h @@ -22,7 +22,7 @@ (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) -#define IS_FP_SAME(_a, _b) (fabs((_a) - (_b)) < 0.000001 * MAX(fabs(_a), fabs(_b))) +#define IS_FP_SAME(_a, _b) (fabs((_a) - (_b)) <= 0.000001 * MAX(fabs(_a), fabs(_b))) static inline int same_string(const char *a, const char *b) { -- cgit v1.2.3-70-g09d2