Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
7921:fcc70f30fe31 | 7922:935be827eaf8 |
---|---|
493 | 493 |
494 return b; | 494 return b; |
495 } | 495 } |
496 | 496 |
497 // FIXME -- this is not quite the right thing. | 497 // FIXME -- this is not quite the right thing. |
498 | |
499 bool | |
500 ComplexNDArray::any_element_is_nan (void) const | |
501 { | |
502 octave_idx_type nel = nelem (); | |
503 | |
504 for (octave_idx_type i = 0; i < nel; i++) | |
505 { | |
506 Complex val = elem (i); | |
507 if (xisnan (val)) | |
508 return true; | |
509 } | |
510 return false; | |
511 } | |
498 | 512 |
499 bool | 513 bool |
500 ComplexNDArray::any_element_is_inf_or_nan (void) const | 514 ComplexNDArray::any_element_is_inf_or_nan (void) const |
501 { | 515 { |
502 octave_idx_type nel = nelem (); | 516 octave_idx_type nel = nelem (); |