From 3ea2c632d50870966320bc13d716959745d1e7dd Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 26 Feb 2007 11:55:45 -0500 Subject: [svn-r13388] Added a relative comparison between floating-point values to avoid compiler's warning of comparing values with "==" or "!=". --- test/dsets.c | 6 ++++-- test/h5test.c | 1 + test/h5test.h | 12 +++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 81fcf11..196fefe 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5160,7 +5160,7 @@ test_set_local(hid_t fapl) h5_fixname(FILENAME[5], fapl, filename, sizeof filename); /* Initialize the integer & floating-point dataset */ - n=0.0; + n=1.0; for (i = 0; i < DSET_DIM1; i++) for (j = 0; j < DSET_DIM2; j++) { points[i][j] = (int)n++; @@ -5356,7 +5356,9 @@ test_set_local(hid_t fapl) /* Check that the values read are the modified version of what was written */ for (i=0; iFLT_EPSILON) || \ - (T==2 && fabs(X-Y)>DBL_EPSILON) || \ - (T==3 && fabsl(X-Y)>LDBL_EPSILON))*/ +#define FLT_REL_EQUAL(X,Y,M) (fabsf((Y-X)/X