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 b6a30dcdd3 ("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>
This commit is contained in:
Dirk Hohndel 2014-02-15 18:15:22 -08:00
parent cdb69aea09
commit f3c84ccf75

2
dive.h
View file

@ -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>