If both operands of a diff have nans, then those always get reported as different. We should add an option to treat NaNs as equal for purposes of diffing. Some of the logic neede in src/silo/silo.c is...
int DBIsDifferentDouble(double a, double b, double abstol, double reltol, double reltol_eps)
{
double num, den;
/* handle NaNs first */
if (isnan(a))
{
if isnan(b) return 0;
return 1;
}
else if (isnan(b))
{
if isnan(a) return 0;
return 1;
}
/*
* First, see if we should use the alternate diff.
* check |A-B|/(|A|+|B|+EPS) in a way that won't overflow.
*/
if (reltol_eps >= 0 && reltol > 0)
{
If both operands of a diff have nans, then those always get reported as different. We should add an option to treat NaNs as equal for purposes of diffing. Some of the logic neede in
src/silo/silo.c
is...