diff options
author | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-23 02:59:49 (GMT) |
---|---|---|
committer | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-23 02:59:49 (GMT) |
commit | d7414053638316081f11fad78474b2c3cde336c5 (patch) | |
tree | ccdc3f52b06fbaa0804e22f77f19c80e22996f36 /tools | |
parent | 720ba8624aefd5b10783629ab59cb91708c4fcde (diff) | |
parent | 9afaf94bef740f89958a1a8aae369d5f607845f4 (diff) | |
download | hdf5-d7414053638316081f11fad78474b2c3cde336c5.zip hdf5-d7414053638316081f11fad78474b2c3cde336c5.tar.gz hdf5-d7414053638316081f11fad78474b2c3cde336c5.tar.bz2 |
Merge pull request #2295 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/float to develop
* commit '9afaf94bef740f89958a1a8aae369d5f607845f4':
not use hdf5 private header
fix float type cmp warning
fix float type cmp warning
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5diff_array.c | 6 | ||||
-rw-r--r-- | tools/test/perform/pio_perf.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 8321a98..e99b2cc 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -4584,7 +4584,7 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *opts) { return FALSE; } - if (value == expected) + if (H5_DBL_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) @@ -4628,7 +4628,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts) return FALSE; } - if (value == expected) + if (H5_DBL_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) @@ -4670,7 +4670,7 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { return FALSE; } - if (value == expected) + if (H5_FLT_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 5977731..1a40f44 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -80,8 +80,12 @@ #define PIO_MPI 0x2 #define PIO_HDF5 0x4 +#define DBL_EPSILON 2.2204460492503131e-16 +#define H5_DBL_ABS_EQUAL(X,Y) (fabsf((X)-(Y)) < DBL_EPSILON) + /* report 0.0 in case t is zero too */ #define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL((t), 0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 |