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

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

[Octave-bug-tracker] [bug #29628] assignment of logical argument is brok


From: Rik
Subject: [Octave-bug-tracker] [bug #29628] assignment of logical argument is broken
Date: Wed, 21 Apr 2010 16:57:12 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9

Update of bug #29628 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

This is confirmed on a recent hg tip (fdf28dae0f37, Apr 20th:2010)

Assignments using a null selection have trouble when the rhs side is not of
type double.

For example,
-----------------------------------
octave:1> x([]) = single(1)
x = [](0x0)
octave:2> whos
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
       ans         1x13                       111  cell
       x           0x0                          0  double

Total is 13 elements using 111 bytes
-----------------------------------

This correctly sets x to [] but fails to set the class correctly to single.

----------------------------------
octave:7> clear x
octave:8> x([]) = logical(1)
x = 0
octave:9> whos
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
       ans         1x13                       111  cell
       x           1x1                          1  logical

Total is 14 elements using 112 bytes

----------------------------------

This correctly sets the class to logical but does not initialize the value of
x to the null array.

----------------------------------
octave:10> clear x
octave:11> x([]) = char("A")
x =
octave:12> whos
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
       ans         1x13                       111  cell
       x           0x0                          0  char

Total is 13 elements using 111 bytes

-----------------------------------

The operator seems to work correctly for the char datatype.

It appears 'single' and 'logical' need some work.

    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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