diff liboctave/CMatrix.cc @ 11130:7c573eb981eb

consistently give error for operator not applied to NaN values
author John W. Eaton <jwe@octave.org>
date Thu, 21 Oct 2010 16:12:13 -0400
parents 3622db30ff05
children 5ea2644b0111
line wrap: on
line diff
--- a/liboctave/CMatrix.cc
+++ b/liboctave/CMatrix.cc
@@ -3044,6 +3044,9 @@
 boolMatrix
 ComplexMatrix::operator ! (void) const
 {
+  if (any_element_is_nan ())
+    gripe_nan_to_logical_conversion ();
+
   return do_mx_unary_op<bool, Complex> (*this, mx_inline_not);
 }