From b3ef8044cf1a61943a2c13826e8cc45668c66a74 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 3 May 2022 00:20:51 +0000 Subject: 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. --- test/dt_arith.c | 10 +++++----- 1 file 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); -- cgit v0.12