Mercurial > hg > octave-nkf
diff liboctave/CNDArray.cc @ 7922:935be827eaf8
error for NaN values in & and | expressions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 11 Jul 2008 14:56:30 -0400 |
parents | 82be108cc558 |
children | 25bc2d31e1bf |
line wrap: on
line diff
--- a/liboctave/CNDArray.cc +++ b/liboctave/CNDArray.cc @@ -497,6 +497,20 @@ // FIXME -- this is not quite the right thing. bool +ComplexNDArray::any_element_is_nan (void) const +{ + octave_idx_type nel = nelem (); + + for (octave_idx_type i = 0; i < nel; i++) + { + Complex val = elem (i); + if (xisnan (val)) + return true; + } + return false; +} + +bool ComplexNDArray::any_element_is_inf_or_nan (void) const { octave_idx_type nel = nelem ();