# HG changeset patch # User jwe # Date 1170998091 0 # Node ID 6110e7d4e4c4ca2dda17bd0fe65c4f99c6922367 # Parent 750b40fe7b0296c8a5e63132f6bf2ea8ea182182 [project @ 2007-02-09 05:14:51 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-02-09 John W. Eaton + + * testfun/assert.m: Try to avoid problems when comparisons involve + strange values like Inf+NaNi. + 2007-02-08 John W. Eaton * plot/drawnow.m: Use gnuplot_binary() instead of just "gnuplot" diff --git a/scripts/testfun/assert.m b/scripts/testfun/assert.m --- a/scripts/testfun/assert.m +++ b/scripts/testfun/assert.m @@ -138,7 +138,9 @@ elseif any(isna(A) != isna(B)) iserror = 1; coda = "NAs don't match"; - elseif any(A(isinf(A)) != B(isinf(B))) + ## Try to avoid problems comparing strange values like Inf+NaNi. + elseif (any(isinf(A) != isinf(B)) + || any(A(isinf(A) & !isnan(A)) != B(isinf(B) & !isnan(B)))) iserror = 1; coda = "Infs don't match"; else