bugGNU Octave - Bugs: bug #42563, norm([]) returns garbage

 
 

bug #42563: norm([]) returns garbage

Submitter:  Johan Löfberg <johanlofberg>
Submitted:  Mon 16 Jun 2014 05:47:15 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.1 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 16 Jun 2014 04:06:06 PM UTC, comment #4: 

I modified Pantxo's changeset slightly to avoid an extra test on the input class of the variable and committed it to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/7bf70dc7f06c).  This will be a part of the 3.8.2 bug fix release.  Thanks for the patch Pantxo!

Rik <rik5>
Group administrator
Mon 16 Jun 2014 04:01:46 PM UTC, comment #3: 

This is actually a regression from 3.2.4 where this used to return 0.

Rik <rik5>
Group administrator
Mon 16 Jun 2014 10:48:19 AM UTC, comment #2: 

Something has happened with the post (markup?). The original post said "0 would be the expected result".

Johan Löfberg <johanlofberg>
Mon 16 Jun 2014 10:45:08 AM UTC, comment #1: 

Hi,

I tested "norm ([])" in Matlab and it returns 0, not 1. Why would you expect 1?

If you agree with this return value, I attached a simple patch for xnorm.cc.



(file #31562)

Pantxo Diribarne <pantxo>
Group Member
Mon 16 Jun 2014 05:47:15 AM UTC, original submission:  
  1. would be the expected result, but I get random results



>> norm([])
ans =   8.7045e+195
>> norm([])
ans =   3.4198e-253
>> norm([])
ans =   3.6202e-253


Johan Löfberg <johanlofberg>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31562:  bugnorm_42563.patch added by pantxo (796B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by johanlofberg (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
    2014-06-16 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2014-06-16 rik5 Item GroupIncorrect Result Regression
        StatusNone Confirmed
    2014-06-16 pantxo Attached File- Added bugnorm_42563.patch, #31562

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code