diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-02-15 18:15:22 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-15 18:15:22 -0800 |
commit | f3c84ccf75a4955d0927f9d86a9c26a840f83add (patch) | |
tree | 2a28109af06598966f32cfe87ca67650c84ef438 | |
parent | cdb69aea090cd142dbeb53e6c40df2d68299e686 (diff) | |
download | subsurface-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.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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> |