aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-15 18:15:22 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-15 18:15:22 -0800
commitf3c84ccf75a4955d0927f9d86a9c26a840f83add (patch)
tree2a28109af06598966f32cfe87ca67650c84ef438
parentcdb69aea090cd142dbeb53e6c40df2d68299e686 (diff)
downloadsubsurface-f3c84ccf75a4955d0927f9d86a9c26a840f83add.tar.gz
Math is hard. Let's go shopping.
Alternatively, we could use fabs() to determine the absolute value of floating point arguments. The author of commit b6a30dcdd3225 ("Improve floating point equality test") clearly has a rather loose definition of "improve". And the maintainer who accepted that patch shares the blame... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index fcb0727df..2e0039f80 100644
--- a/dive.h
+++ b/dive.h
@@ -21,7 +21,7 @@
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
-#define IS_FP_SAME(_a,_b) (abs((_a) - (_b)) < 0.000001 * MAX(abs(_a), abs(_b)))
+#define IS_FP_SAME(_a,_b) (fabs((_a) - (_b)) < 0.000001 * MAX(fabs(_a), fabs(_b)))
#include <libxml/tree.h>
#include <libxslt/transform.h>