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

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

[Octave-bug-tracker] [bug #33537] lower function returns incorect result


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #33537] lower function returns incorect result on numerical values
Date: Sun, 12 Jun 2011 19:32:40 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.19) Gecko/20110430 Iceweasel/3.5.19 (like Firefox/3.5.19)

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

In the case of


lower([ 90 100 'ABC']) 


the argument is already converted to a character array, so this is
consistent.

In the old days, Matlab did not really have character data, but just had a
flag saying that a numeric array was supposed to be treated as ASCII
characters.  So that's probably why Octave behaves the way it does.

But if we change this, why should we change it to leave numeric data alone? 
Shouldn't we issue an error instead?  The Matlab docs don't seem to say that
lower/upper simply return their arguments if they are not character strings or
cell arrays of character strings.  So you are asking for bug-for-bug
compatibility?

If we should have lower/upper simply return non character arguments, does that
apply to everything?  What happens for structures or cells containing
non-string values?  What about cell arrays with some character values and some
other values (structs, function handles whatever)?

My fix would probably be to just throw an error if the argument is not a
character string or cell array of character strings.

How does it help to allow lower/upper to be called with arguments that are not
character strings or cell arrays of character strings?

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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