bugGNU Octave - Bugs: bug #31396, not() and !-operator treats NaN as...

 
 

bug #31396: not() and !-operator treats NaN as true

Submitted by:  None
Submitted on:  Thu 21 Oct 2010 02:57:20 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Kim HansenOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
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 07:45:36 PM UTC, comment #2:

It's true that the problem has been fixed for scalars, but it has not yet been fixed for arrays. I'm working on a patch for that.

John W. Eaton <jwe>
Project Administrator
Thu 21 Oct 2010 07:12:10 PM UTC, comment #1:

This bug exists in the 3.2.4 code, but has been fixed in the Mercurial code repository. To access the fix you will need to build from source using one of the snapshots (such as 3.3.53) or use Mercurial to get the code directly. Instructions for downloading the code are here (http://www.gnu.org/software/octave/download.html)

Rik <rik5>
Project Administrator
Thu 21 Oct 2010 02:57:20 PM UTC, original submission:

not() and the !-operator treats NaN values as true, I expected them to give the same error that functions like and(), xor() and logical() does.

octave:1> !NaN
ans = 0
octave:2> if (NaN); end
error: invalid conversion from NaN to logical
octave:2> logical(NaN)
error: invalid conversion from NaN to logical
error: called from:
error: /usr/share/octave/3.2.4/m/general/logical.m at line 46, column 2
octave:2> and(NaN,true)
error: invalid conversion from NaN to logical
octave:2>

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Oct 2010 07:12:10 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1