summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-03-29 16:20:19 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-03-29 16:20:19 (GMT)
commitd467c2ce717d4633185b063b58eff262126749b7 (patch)
treecd6964394635ea907f212c496fd6ec71b5540a61 /tools/lib
parentea694afb00e3971edbf913baea660dc315b9d8b7 (diff)
downloadhdf5-d467c2ce717d4633185b063b58eff262126749b7.zip
hdf5-d467c2ce717d4633185b063b58eff262126749b7.tar.gz
hdf5-d467c2ce717d4633185b063b58eff262126749b7.tar.bz2
[svn-r20369] Purpose:
Fixed Bug 2184 - GMQS: h5diff - incorrect calculation code for --use-system-epsilon option Description: Fixed h5diff for --use-system-epsilon option: the calculation changed from ( |a - b| / b ) to ( |a - b| ). This was decided for better performance and was corrected only in HDF5 trunk, so 1.8 got updated. Also comments for equal_XXX() function were updated correctly. Also help page and RM got updated correctly. Also add test cases for testing the differences w/wo the option. Tested: jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 66cd580..c4c8dbf 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -5550,7 +5550,7 @@ error:
/*-------------------------------------------------------------------------
* Function: equal_double
*
- * Purpose: use a relative error formula to deal with floating point
+ * Purpose: use a absolute error formula to deal with floating point
* uncertainty
*
* Modifications:
@@ -5604,7 +5604,7 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options)
/*-------------------------------------------------------------------------
* Function: equal_ldouble
*
- * Purpose: use a relative error formula to deal with floating point
+ * Purpose: use a absolute error formula to deal with floating point
* uncertainty
*
*-------------------------------------------------------------------------
@@ -5647,7 +5647,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio
return TRUE;
if (options->use_system_epsilon) {
- if ( ABS( (value-expected) / expected) < DBL_EPSILON)
+ if ( ABS( (value-expected) ) < DBL_EPSILON)
return TRUE;
}
@@ -5660,7 +5660,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio
/*-------------------------------------------------------------------------
* Function: equal_float
*
- * Purpose: use a relative error formula to deal with floating point
+ * Purpose: use a absolute error formula to deal with floating point
* uncertainty
*
* Modifications:
@@ -5704,7 +5704,7 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options)
return TRUE;
if (options->use_system_epsilon) {
- if ( ABS( (value-expected) / expected) < FLT_EPSILON)
+ if ( ABS( (value-expected) ) < FLT_EPSILON)
return TRUE;
}