summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-03-12 09:23:51 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-03-12 09:23:51 (GMT)
commit8f874a501024607e617200c28d16c20757ddb29e (patch)
tree93148e5c161de3dd14d6182f95792506ac98c46d /src/H5private.h
parent5938b81835746550f5adc5f76c9110ec37ed82a1 (diff)
downloadhdf5-8f874a501024607e617200c28d16c20757ddb29e.zip
hdf5-8f874a501024607e617200c28d16c20757ddb29e.tar.gz
hdf5-8f874a501024607e617200c28d16c20757ddb29e.tar.bz2
[svn-r29395] Corrected parentheses in floating-point compare macros.
Corrected H5_EB and H5_PB macros. Tested on: 64-bit Ubuntu 15.10 w/ gcc 5.2.1 autotools serial w/ Java, Fortran, & C++
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/H5private.h b/src/H5private.h
index fa5a114..e0ed6ef 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -538,20 +538,21 @@
* It's the developer's responsibility not to pass in the value 0, which
* may cause the equation to fail.
*/
-#define H5_FLT_ABS_EQUAL(X,Y) (HDfabsf(X-Y) < FLT_EPSILON)
-#define H5_DBL_ABS_EQUAL(X,Y) (HDfabs (X-Y) < DBL_EPSILON)
-#define H5_LDBL_ABS_EQUAL(X,Y) (HDfabsl(X-Y) < LDBL_EPSILON)
+#define H5_FLT_ABS_EQUAL(X,Y) (HDfabsf((X)-(Y)) < FLT_EPSILON)
+#define H5_DBL_ABS_EQUAL(X,Y) (HDfabs ((X)-(Y)) < DBL_EPSILON)
+#define H5_LDBL_ABS_EQUAL(X,Y) (HDfabsl((X)-(Y)) < LDBL_EPSILON)
-#define H5_FLT_REL_EQUAL(X,Y,M) (HDfabsf((Y-X) / X) < M)
-#define H5_DBL_REL_EQUAL(X,Y,M) (HDfabs ((Y-X) / X) < M)
-#define H5_LDBL_REL_EQUAL(X,Y,M) (HDfabsl((Y-X) / X) < M)
+#define H5_FLT_REL_EQUAL(X,Y,M) (HDfabsf(((Y)-(X)) / (X)) < (M))
+#define H5_DBL_REL_EQUAL(X,Y,M) (HDfabs (((Y)-(X)) / (X)) < (M))
+#define H5_LDBL_REL_EQUAL(X,Y,M) (HDfabsl(((Y)-(X)) / (X)) < (M))
-/* KiB, MiB, GiB, TiB, EiB - Used in profiling and timing code */
+/* KiB, MiB, GiB, TiB, PiB, EiB - Used in profiling and timing code */
#define H5_KB (1024.0F)
#define H5_MB (1024.0F * 1024.0F)
#define H5_GB (1024.0F * 1024.0F * 1024.0F)
#define H5_TB (1024.0F * 1024.0F * 1024.0F * 1024.0F)
-#define H5_EB (1024.0F * 1024.0F * 1024.0F * 1024.0F * 1024.0F)
+#define H5_PB (1024.0F * 1024.0F * 1024.0F * 1024.0F * 1024.0F)
+#define H5_EB (1024.0F * 1024.0F * 1024.0F * 1024.0F * 1024.0F * 1024.0F)
#ifndef H5_HAVE_FLOCK
/* flock() operations. Used in the source so we have to define them when