summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-01-21 21:43:07 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-21 14:07:10 -0800
commit2f822ec0dcd2d715bf4234023b510aed9fe90f0b (patch)
tree0b787fc3062e3e0f06e637255b38687284867c58 /dive.h
parent4159faa950dbb5c826987402f5b670af3aa013a7 (diff)
downloadsubsurface-2f822ec0dcd2d715bf4234023b510aed9fe90f0b.tar.gz
Prevent potential math overflow in new profile
Test for max_temp == min_temp to prevent math overflow when calculating temperature axis in new profile Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index e4c4e354c..c56d569ad 100644
--- a/dive.h
+++ b/dive.h
@@ -20,6 +20,8 @@
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
+#define IS_FP_SAME(_a,_b) (abs((_a) - (_b)) < 0.000001)
+
#include <libxml/tree.h>
#include <libxslt/transform.h>