octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #31396] not() and !-operator treats NaN as tru


From: anonymous
Subject: [Octave-bug-tracker] [bug #31396] not() and !-operator treats NaN as true
Date: Thu, 21 Oct 2010 14:57:21 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100821 Iceweasel/3.6.8 (like Firefox/3.6.8)

URL:
  <http://savannah.gnu.org/bugs/?31396>

                 Summary: not() and !-operator treats NaN as true
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 21 Oct 2010 02:57:20 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Kim Hansen
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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> 





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31396>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]