diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-12 15:52:52 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-12 15:52:52 (GMT) |
commit | 3015df0a5b02dee38264b191997c1949596c2c95 (patch) | |
tree | 6e26bbe1228af8a0ed8eea213f99989956350981 /test/th5s.c | |
parent | 8d91f0643b411da90476e2ac4fabca32b3045845 (diff) | |
download | hdf5-3015df0a5b02dee38264b191997c1949596c2c95.zip hdf5-3015df0a5b02dee38264b191997c1949596c2c95.tar.gz hdf5-3015df0a5b02dee38264b191997c1949596c2c95.tar.bz2 |
[svn-r13501] Suppress the compiler warning about the equality comparison of floating-point values.
Diffstat (limited to 'test/th5s.c')
-rw-r--r-- | test/th5s.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/th5s.c b/test/th5s.c index 661f582..a67d5a2 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1020,7 +1020,7 @@ test_h5s_chunk(void) /* Initialize float array */ for(i=0; i<50000; i++) for(j=0; j<3; j++) - chunk_data_flt[i][j]=(float)(i*2.5-j*100.3); + chunk_data_flt[i][j]=(float)((i+1)*2.5-j*100.3); status= H5Dwrite(dsetID,H5T_NATIVE_FLOAT,H5S_ALL,H5S_ALL,H5P_DEFAULT,chunk_data_flt); CHECK(status, FAIL, "H5Dwrite"); @@ -1055,7 +1055,8 @@ test_h5s_chunk(void) for(i=0; i<50000; i++) { for(j=0; j<3; j++) { - if(chunk_data_dbl[i][j]!=chunk_data_flt[i][j]) + /* Check if the two values are within 0.001% range. */ + if(!DBL_REL_EQUAL(chunk_data_dbl[i][j],chunk_data_flt[i][j], 0.00001)) TestErrPrintf("chunk_data_dbl[%d][%d]=%f, chunk_data_flt[%d][%d]=%f\n",i,j,chunk_data_dbl[i][j],i,j,chunk_data_flt[i][j]); } /* end for */ } /* end for */ |