Mercurial > hg > octave-nkf
changeset 6291:6110e7d4e4c4
[project @ 2007-02-09 05:14:51 by jwe]
author | jwe |
---|---|
date | Fri, 09 Feb 2007 05:14:51 +0000 |
parents | 750b40fe7b02 |
children | 3588fc904484 |
files | scripts/ChangeLog scripts/testfun/assert.m |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-02-09 John W. Eaton <jwe@octave.org> + + * testfun/assert.m: Try to avoid problems when comparisons involve + strange values like Inf+NaNi. + 2007-02-08 John W. Eaton <jwe@octave.org> * plot/drawnow.m: Use gnuplot_binary() instead of just "gnuplot"
--- 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