Mercurial > octave
diff src/ov-complex.cc @ 5958:85c7dc4afe6b
[project @ 2006-08-23 18:35:38 by jwe]
author | jwe |
---|---|
date | Wed, 23 Aug 2006 18:35:39 +0000 |
parents | cdef72fcd206 |
children | 9e32bb109980 |
line wrap: on
line diff
--- a/src/ov-complex.cc Wed Aug 23 14:09:40 2006 +0000 +++ b/src/ov-complex.cc Wed Aug 23 18:35:39 2006 +0000 @@ -176,43 +176,19 @@ } bool -octave_complex::save_ascii (std::ostream& os, bool& infnan_warned, - int strip_nan_and_inf) +octave_complex::save_ascii (std::ostream& os, bool& infnan_warned) { Complex c = complex_value (); - if (strip_nan_and_inf) + if (! infnan_warned && (xisnan (c) || xisinf (c))) { - if (xisnan (c)) - { - error ("only value to plot is NaN"); - return false; - } - else - { - double re = real (c); - double im = imag (c); - - re = xisinf (re) ? (re > 0 ? OCT_RBV : -OCT_RBV) : re; - im = xisinf (im) ? (im > 0 ? OCT_RBV : -OCT_RBV) : im; + warning ("save: Inf or NaN values may not be reloadable"); + infnan_warned = true; + } + + octave_write_complex (os, c); - c = Complex (re, im); - - octave_write_complex (os, c); - os << "\n"; - } - } - else - { - if (! infnan_warned && (xisnan (c) || xisinf (c))) - { - warning ("save: Inf or NaN values may not be reloadable"); - infnan_warned = true; - } - - octave_write_complex (os, c); - os << "\n"; - } + os << "\n"; return true; }