summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@users.noreply.github.com>2022-05-03 00:20:51 (GMT)
committerGitHub <noreply@github.com>2022-05-03 00:20:51 (GMT)
commitb3ef8044cf1a61943a2c13826e8cc45668c66a74 (patch)
tree132bac1d394d161b835469d23cc72540ba7da647
parent2ba7a01bfff451b043e2ec00811c0aad78921545 (diff)
downloadhdf5-b3ef8044cf1a61943a2c13826e8cc45668c66a74.zip
hdf5-b3ef8044cf1a61943a2c13826e8cc45668c66a74.tar.gz
hdf5-b3ef8044cf1a61943a2c13826e8cc45668c66a74.tar.bz2
test/dt_arith: use `isnan` instead of self comparison (#1709)
It is more obvious what is being asked this way. Also include a `clang-format` fix.
-rw-r--r--test/dt_arith.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c
index d73dc4e..96e9ab4 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -2694,18 +2694,18 @@ my_isnan(dtype_t type, void *val)
if (FLT_FLOAT == type) {
float x = 0.0;
HDmemcpy(&x, val, sizeof(float));
- retval = !H5_FLT_ABS_EQUAL(x, x);
+ retval = isnan(x);
}
else if (FLT_DOUBLE == type) {
double x = 0.0;
HDmemcpy(&x, val, sizeof(double));
- retval = !H5_DBL_ABS_EQUAL(x, x);
+ retval = isnan(x);
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
}
else if (FLT_LDOUBLE == type) {
long double x = 0.0L;
HDmemcpy(&x, val, sizeof(long double));
- retval = !H5_LDBL_ABS_EQUAL(x, x);
+ retval = isnan(x);
#endif
}
else {
@@ -3668,8 +3668,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
}
/* Allocate and initialize the source buffer through macro INIT_INTEGER if the source is integer,
- * INIT_FP_NORM if floating-point. The BUF will be used for the conversion while the SAVED buffer will be
- * used for the comparison later.
+ * INIT_FP_NORM if floating-point. The BUF will be used for the conversion while the SAVED buffer
+ * will be used for the comparison later.
*/
if (src_type == INT_SCHAR) {
INIT_INTEGER(signed char, SCHAR_MAX, SCHAR_MIN, src_size, dst_size, src_nbits, buf, saved, nelmts);