bugGNU Octave - Bugs: bug #56031, eye produces wrong output when...

 
 

bug #56031: eye produces wrong output when multiplied with infinity or NaN

Submitter:  Gerrit Ansmann <wrzlprmft>
Submitted:  Sat 30 Mar 2019 08:13:04 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.4.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 31 Mar 2019 11:52:43 PM UTC, comment #4: 

Closing and marking with status "won't fix" since this behavior is explicitly documented in the Octave user manual.

Mike Miller <mtmiller>
Group Member
Sat 30 Mar 2019 08:47:36 AM UTC, comment #3: 

According to the Octave document
https://octave.org/doc/interpreter/Zeros-Treatment.html

This is a feature, not a bug.

Anonymous
Sat 30 Mar 2019 08:19:54 AM UTC, comment #2: 

PPS: It should be


x = my_eye(1,2);


in the example. The problem is not affected by this.

Gerrit Ansmann <wrzlprmft>
Sat 30 Mar 2019 08:16:28 AM UTC, comment #1: 

PS: It should be

x = eye(1,2);
-verbatim+

in the first line under *Preliminary Checks* in the example. The problem is not affected by this.

Gerrit Ansmann <wrzlprmft>
Sat 30 Mar 2019 08:13:04 AM UTC, original submission:  

Consider the following examples:


% Preparation
my_eye = eye(3);
inf_eye = my_eye*inf;
nan_eye = my_eye*nan;

% Preliminary Checks
x = inf_eye(1,2);
assert( isnan(x*inf) );
assert( isnan(x*nan) );

% Actual Problem
assert( isnan(inf_eye(1,2)) );
assert( isnan(nan_eye(1,2)) );


In plain words, multiplying an eye matrix with infinity or NaN yields zero elements outside the diagonal, even though there should be NaNs.

Obviously, this is inconsistent. I first thought this was to reproduce some Matlab weirdness, but Matlab does this correctly.

Gerrit Ansmann <wrzlprmft>

 

(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 wrzlprmft (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-31 mtmiller StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code