Mercurial > hg > octave-nkf
comparison src/ov-flt-re-mat.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 | f336dd8e96d0 |
children | 23c248d415b5 |
comparison
equal
deleted
inserted
replaced
7921:fcc70f30fe31 | 7922:935be827eaf8 |
---|---|
216 } | 216 } |
217 | 217 |
218 boolNDArray | 218 boolNDArray |
219 octave_float_matrix::bool_array_value (bool warn) const | 219 octave_float_matrix::bool_array_value (bool warn) const |
220 { | 220 { |
221 if (warn && matrix.any_element_not_one_or_zero ()) | 221 if (matrix.any_element_is_nan ()) |
222 error ("invalid conversion from NaN to logical"); | |
223 else if (warn && matrix.any_element_not_one_or_zero ()) | |
222 gripe_logical_conversion (); | 224 gripe_logical_conversion (); |
223 | 225 |
224 return boolNDArray (matrix); | 226 return boolNDArray (matrix); |
225 } | 227 } |
226 | 228 |