diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-12 21:43:21 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-12 21:43:21 (GMT) |
commit | cee32cf3a82e88cb7601da8a4e7f6f0b16760414 (patch) | |
tree | 3f9e7d37b0931726229c513a74fadec231b2cb96 /test | |
parent | 831c8d9dfd53ca3d063c3c3f545aed57bcc78613 (diff) | |
download | hdf5-cee32cf3a82e88cb7601da8a4e7f6f0b16760414.zip hdf5-cee32cf3a82e88cb7601da8a4e7f6f0b16760414.tar.gz hdf5-cee32cf3a82e88cb7601da8a4e7f6f0b16760414.tar.bz2 |
[svn-r8509] *** empty log message ***
Diffstat (limited to 'test')
-rw-r--r-- | test/dtypes.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 99731ae..fa946c5 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -4530,6 +4530,20 @@ test_conv_int_float(const char *name, hid_t src, hid_t dst) } /* end if */ #endif /* end H5_ULONG_FP_BOTTOM_BIT_WORKS */ +/* For PGI compiler on Linux, during conversion from 'float' or 'double' to + * 'unsigned long long', round-up happens when the fraction of float-point + * value is greater than 0.5. So we allow the converted value to be off by 1. + */ +#ifndef H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS + if((src_type==FLT_FLOAT || src_type==FLT_DOUBLE) && dst_type==INT_ULLONG) { + unsigned long_long tmp_s, tmp_h; + HDmemcpy(&tmp_s,&buf[j*dst_size],sizeof(unsigned long_long)); + HDmemcpy(&tmp_h,&hw[0],sizeof(unsigned long_long)); + if((tmp_s+1)==tmp_h) + continue; /*no error*/ + } +#endif /*end H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS*/ + /* Print errors */ if (0==fails_this_test++) H5_FAILED(); |