bugGNU Octave - Bugs: bug #31239, isequalwithnans(1,2,1) gives true...

 
 

bug #31239: isequalwithnans(1,2,1) gives true instead of false (patch provided)

Submitted by:  None
Submitted on:  Mon 04 Oct 2010 11:07:39 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Iain MurrayOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 21 Oct 2010 04:16:26 AM UTC, comment #1:

Thanks for supplying a patch. It made the work quite easy. The changes have been made in the following changeset: http://hg.savannah.gnu.org/hgweb/octave/rev/8a8eb099502e.

Rik <rik5>
Project Administrator
Mon 04 Oct 2010 11:07:39 AM UTC, original submission:

When checking several arrays isequalwithnans currently only checks that the last array matches the first. For example:

isequalwithequalnans(1,2,1)

returns true but shouldn't because 1!=2.

The cause is a bug in _isequal_ -- when the first argument to _isequal_ is 1 (to allow nans to be present) the function no longer returns as soon as it notices an inequality not involving nans. As long as the last array to be checked matches, the function forgets about previous inequalities.

I have attached a patch against the version of _isequal_.m I got by checking out the Hg repository just now. I've attached the full version of the patched function too.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #21606:  __isequal__.m.PATCH added by None (443B - text/x-patch)
file #21607:  __isequal__.m added by None (5KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Oct 2010 04:14:42 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 04 Oct 2010 11:07:39 AM UTCNoneAttached File-=>Added _isequal_.m.PATCH, #21606
      Attached File-=>Added _isequal_.m, #21607

    Back to the top


    Powered by Savane 3.1-cleanup1