[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44201] "whos" and gui display non-integer siz

From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #44201] "whos" and gui display non-integer sizes inf/nan poorly
Date: Mon, 09 Feb 2015 18:57:03 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #4, bug #44201 (project octave):

Most of the follow examples from the project test for xisinf() and xisnan():

address@hidden grep '"NaN"' * -r
Binary file doc/interpreter/octave.info-5 matches
etc/OLD-ChangeLogs/ChangeLog.1: with a sign) or "NaN").
gnulib-hg/m4/strtod.m4:    const char *string = "NaN";
junk.log:that was checked to see if it was 'N' for "NaN" rather than "NA".
libinterp/parse-tree/lex.ll:             || tok == "NaN" || tok == "nan")))
libinterp/corefcn/str2double.cc:%!assert (str2double ("NaN"), NaN)
libinterp/corefcn/data.cc:                      lo_ieee_float_nan_value (),
libinterp/corefcn/pr-output.cc:            os << std::setw (fw) << "NaN";
libinterp/corefcn/pr-output.cc:            os << "NaN";
libinterp/corefcn/oct-stream.cc:            tval = (lo_ieee_is_NA (dval) ?
"NA" : "NaN");
libinterp/octave-value/ov-fcn-inline.cc:                          tmp_arg !=
"NaN" && tmp_arg != "nan" &&
liboctave/util/lo-utils.cc:    os << "NaN";
liboctave/util/lo-utils.cc:    os << "NaN";
scripts/general/num2str.m:%!assert (num2str (nan), "NaN")
scripts/general/validateattributes.m:          w_size_str = strrep
(w_size_str, "NaN", "N");
scripts/testfun/assert.m:%!   elseif (strfind (errmsg, "NaN"))

The project should have "NaN" ("Inf") defined as NANSTRING (INFSTRING) or
something similar.

Well, seems like some kind of change is needed...  The attached size.m file,
is that supposed to be general?  If so, this doesn't seem correct:

octave:1> x = [1 2 3]
x =

   1   2   3

octave:2> dim = 1
dim =  1
octave:3> size(x,dim)
ans = NaN

Also, the range test should have a couple more checks for greater than 2:

function [n, m] = size(x, dim)

  sz = [nan inf];

  if ((nargin >= 2) || ...
      (nargout >= 2) || ...
      (nargin == 2) && (nargout == 2))
    error('size: invalid call')


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]