bugGNU Octave - Bugs: bug #41011, scalar indexed assignment should...

 
 

bug #41011: scalar indexed assignment should cast input type

Submitter:  Felipe G. Nievinski <fgnievinski>
Submitted:  Fri 27 Dec 2013 03:34:14 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 04 Aug 2021 04:57:01 AM UTC, comment #4: 

You're right.  This has been fixed at some point.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Sun 01 Aug 2021 01:16:20 PM UTC, comment #3: 

Using 6.1.0
It appears to be working.


>> temp = [true, false];  temp(1) = 0;  class(temp)
ans = logical
>> temp = true;  temp(1) = 0;  class(temp)
ans = logical
>> temp = true;  temp(2) = 0;  class(temp)
ans = logical



Anonymous
Fri 25 Nov 2016 10:50:15 PM UTC, comment #2: 

This bug is still present in Octave 4.2.0.

Hartmut <hardy>
Sat 28 Dec 2013 07:26:50 PM UTC, comment #1: 

Confirmed on the development branch as well.

An example of Octave getting it right is the use of 'single' or 'uint8'.


temp = single (1); temp(1) = 2; class (temp)
ans = single
temp = uint8 (1); temp(1) = 2; class (temp)
ans = uint8


The same behavior should hold for class logical, but fails


temp = logical (1); temp(1) = 0; class (temp)
ans = double


Rik <rik5>
Group administrator
Fri 27 Dec 2013 03:34:14 AM UTC, original submission:  

In Octave:

octave:8> temp = [true, false];  temp(1) = 0;  class(temp)
ans = logical
octave:9> temp = true;  temp(1) = 0;  class(temp)
ans = double
octave:10> temp = true;  temp(2) = 0;  class(temp)
ans = double


In Matlab:

>> temp = [true, false];  temp(1) = 0;  class(temp)

ans =
logical

>> temp = true;  temp(1) = 0;  class(temp)

ans =
logical

>> temp = true;  temp(2) = 0;  class(temp)

ans =
logical

Felipe G. Nievinski <fgnievinski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by fgnievinski (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-08-04 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-03-31 mtmiller Operating SystemMicrosoft Windows Any
    2013-12-28 rik5 StatusNone Confirmed
        Release3.6.4 dev

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code