# HG changeset patch # User jwe # Date 1073774959 0 # Node ID 3387590ed11dca332f03707dfcdab402438ee60c # Parent ae49c6ba722cc3f5b4c3d747f3ba925413ac778b [project @ 2004-01-10 22:49:19 by jwe] diff -r ae49c6ba722c -r 3387590ed11d src/ChangeLog --- a/src/ChangeLog Sat Jan 10 22:15:47 2004 +0000 +++ b/src/ChangeLog Sat Jan 10 22:49:19 2004 +0000 @@ -1,5 +1,10 @@ 2004-01-10 John W. Eaton + * 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. diff -r ae49c6ba722c -r 3387590ed11d src/oct-stream.cc --- a/src/oct-stream.cc Sat Jan 10 22:15:47 2004 +0000 +++ b/src/oct-stream.cc Sat Jan 10 22:49:19 2004 +0000 @@ -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,