Mercurial > hg > octave-avbm
changeset 4693:3387590ed11d
[project @ 2004-01-10 22:49:19 by jwe]
author | jwe |
---|---|
date | Sat, 10 Jan 2004 22:49:19 +0000 |
parents | ae49c6ba722c |
children | dd8d08c41c0c |
files | src/ChangeLog src/oct-stream.cc |
diffstat | 2 files changed, 19 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2004-01-10 John W. Eaton <jwe@bevo.che.wisc.edu> + * oct-stream.cc (convert_to_valid_int, get_size): + Use lo_ieee_is_NaN_or_NA instead of xisnan. + (octave_base_stream::do_printf): Correct special case check for + NA, NaN, Inf, or out of range integers. + * dirfns.cc (Fglob): Always return list of files as a cell array. (Freaddir): Likewise.
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -62,7 +62,7 @@ if (! error_state) { - if (! xisnan (dval)) + if (! lo_ieee_is_NaN_or_NA (dval)) { int ival = NINT (dval); @@ -85,7 +85,7 @@ { int retval = -1; - if (! xisnan (d)) + if (! lo_ieee_is_NaN_or_NA (d)) { if (! xisinf (d)) { @@ -2383,24 +2383,25 @@ if (val_cache) { - if ((xisnan (val) || xisinf (val) - || val > INT_MAX || val < INT_MIN) - && (elt->type == 'd' - || elt->type == 'i' - || elt->type == 'c' - || elt->type == 'o' - || elt->type == 'x' - || elt->type == 'X' - || elt->type == 'u')) + if (lo_ieee_is_NaN_or_NA (val) || xisinf (val) + || ((val > INT_MAX || val < INT_MIN) + && (elt->type == 'd' + || elt->type == 'i' + || elt->type == 'c' + || elt->type == 'o' + || elt->type == 'x' + || elt->type == 'X' + || elt->type == 'u'))) { std::string tfmt = fmt; - if (xisnan (val) || xisinf (val)) + if (lo_ieee_is_NaN_or_NA (val) || xisinf (val)) { tfmt.replace (tfmt.rfind (elt->type), 1, 1, 's'); const char *tval = xisinf (val) - ? (val < 0 ? "-Inf" : "Inf") : "NaN"; + ? (val < 0 ? "-Inf" : "Inf") + : (lo_ieee_is_NA (val) ? "NA" : "NaN"); retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2,