summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r--tools/lib/h5diff_array.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 2cda3ba..735ea70 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -20,7 +20,6 @@
#include "h5tools.h"
-
#include <sys/timeb.h>
#include <time.h>
@@ -364,9 +363,9 @@ hsize_t diff_array( void *_mem1,
* H5T_COMPOUND
* Recursively call this function for each member
* H5T_ARRAY
- * Recursively call this function for each element�
+ * Recursively call this function for each element
* H5T_VLEN
- * Recursively call this function for each element�
+ * Recursively call this function for each element
* H5T_STRING
* compare byte by byte in a cycle from 0 to type_size. this type_size is the
* value obtained by the get_size function but it is the string lenght for
@@ -3056,15 +3055,11 @@ hsize_t diff_float(unsigned char *mem1,
*/
else
{
-
-
-
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_float, mem1, sizeof(float));
memcpy(&temp2_float, mem2, sizeof(float));
-
if (equal_float(temp1_float,temp2_float,options)==FALSE)
{
if ( print_data(options) )
@@ -5548,6 +5543,9 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options)
if (is_zero)
return(equal_double(expected,value,options));
+ if (value == expected)
+ return TRUE;
+
if ( ABS( (value-expected) / expected) < H5DIFF_DBL_EPSILON)
return TRUE;
else
@@ -5609,6 +5607,9 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio
if (is_zero)
return(equal_ldouble(expected,value,options));
+ if (value == expected)
+ return TRUE;
+
if ( ABS( (value-expected) / expected) < H5DIFF_DBL_EPSILON)
return TRUE;
else
@@ -5673,6 +5674,9 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options)
if (is_zero)
return(equal_float(expected,value,options));
+ if (value == expected)
+ return TRUE;
+
if ( ABS( (value-expected) / expected) < H5DIFF_FLT_EPSILON)
return TRUE;
else