octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51412] strcmp with multidimensional char arra


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51412] strcmp with multidimensional char arrays
Date: Mon, 10 Jul 2017 13:16:57 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #5, bug #51412 (project octave):

In addition I think we need to be wary about the definitions of "string" and
"cell string" in this function, and places where string_value and
cellstr_value are used to compare two operands.

The is_string and iscellstr tests return true for values that cannot be
exactly represented by our normal definition of what a "string" is.

Simple example of a two-dimensional character matrix:


>> a = ['aaa'; 'bbb'];
>> string_value (a)
ans = aaa
>> cellstr_value (a)
ans =
{
  [1,1] = aaa
}


The string_value method truncates a multi-dimensional character vector to
return just the first row (this has been discussed in other bug reports). The
cellstr_value method calls string_value.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51412>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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