mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r17680] Use absolute comparison for use-system-epsilon and default option.
This commit is contained in:
parent
b7e61c869b
commit
a8aa10bd21
@ -5595,7 +5595,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;
|
||||
}
|
||||
|
||||
@ -5652,7 +5652,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user