summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-08-31 20:14:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-08-31 20:14:57 (GMT)
commit2c91cbecc6460d1a319bfb2303e228ea6f6d6e4d (patch)
tree3d69591861803060012eed0be300427f4c261fc8 /tools/lib/h5diff_array.c
parent1d3a7ec6515f26f13cb5d8e5c65fd848fd235d8f (diff)
parent81ca9e4c79a125cfcea9e426e1e91d94cdf6a2aa (diff)
downloadhdf5-2c91cbecc6460d1a319bfb2303e228ea6f6d6e4d.zip
hdf5-2c91cbecc6460d1a319bfb2303e228ea6f6d6e4d.tar.gz
hdf5-2c91cbecc6460d1a319bfb2303e228ea6f6d6e4d.tar.bz2
[svn-r27630] Description:
Bring in changes from the trunk, through r27628. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (h5committest not required on this branch)
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r--tools/lib/h5diff_array.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 71ada53..d592528 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -102,29 +102,29 @@
static hbool_t not_comparable;
-#define PER(A,B) { \
- per = -1; \
- not_comparable = FALSE; \
- both_zero = FALSE; \
- if(0 == (A) && 0 == (B)) \
- both_zero = TRUE; \
- if(0 != (A)) \
- per = (double)ABS((double)((B) - (A)) / (double)(A)); \
- else \
- not_comparable = TRUE; \
+#define PER(A,B) { \
+ per = -1; \
+ not_comparable = FALSE; \
+ both_zero = FALSE; \
+ if(H5_DBL_ABS_EQUAL(0,A) && H5_DBL_ABS_EQUAL(0,B)) \
+ both_zero = TRUE; \
+ if(!H5_DBL_ABS_EQUAL(0,A)) \
+ per = (double)ABS((double)((B) - (A)) / (double)(A)); \
+ else \
+ not_comparable = TRUE; \
}
-#define PER_UNSIGN(TYPE,A,B) { \
- per = -1; \
- not_comparable = FALSE; \
- both_zero = FALSE; \
- if((A) == 0 && (B) == 0) \
- both_zero = TRUE; \
- if((A) != 0) \
- per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \
- else \
- not_comparable = TRUE; \
+#define PER_UNSIGN(TYPE,A,B) { \
+ per = -1; \
+ not_comparable = FALSE; \
+ both_zero = FALSE; \
+ if(H5_DBL_ABS_EQUAL(0,A) && H5_DBL_ABS_EQUAL(0,B)) \
+ both_zero = TRUE; \
+ if(!H5_DBL_ABS_EQUAL(0,A)) \
+ per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \
+ else \
+ not_comparable = TRUE; \
}