diff liboctave/dNDArray.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 9478b216752e
children fd0a3ac60b0e
line wrap: on
line diff
--- a/liboctave/dNDArray.cc	Thu Oct 21 16:12:00 2010 -0400
+++ b/liboctave/dNDArray.cc	Thu Oct 21 16:12:13 2010 -0400
@@ -541,6 +541,9 @@
 boolNDArray
 NDArray::operator ! (void) const
 {
+  if (any_element_is_nan ())
+    gripe_nan_to_logical_conversion ();
+
   return do_mx_unary_op<bool, double> (*this, mx_inline_not);
 }