diff liboctave/fCNDArray.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/fCNDArray.cc
+++ b/liboctave/fCNDArray.cc
@@ -492,6 +492,20 @@
 // FIXME -- this is not quite the right thing.
 
 bool
+FloatComplexNDArray::any_element_is_nan (void) const
+{
+  octave_idx_type nel = nelem ();
+
+  for (octave_idx_type i = 0; i < nel; i++)
+    {
+      FloatComplex val = elem (i);
+      if (xisnan (val))
+	return true;
+    }
+  return false;
+}
+
+bool
 FloatComplexNDArray::any_element_is_inf_or_nan (void) const
 {
   octave_idx_type nel = nelem ();