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

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

[Octave-bug-tracker] [bug #44071] ismember fails with unsorted complex s


From: Rik
Subject: [Octave-bug-tracker] [bug #44071] ismember fails with unsorted complex set
Date: Mon, 26 Jan 2015 23:35:20 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)

Update of bug #44071 (project octave):

                  Status:               Confirmed => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #4:

There was a cut and paste error in Array-C.cc where instead of comparing x and
y, x and x were compared.


diff -r e68267373191 liboctave/array/Array-C.cc
--- a/liboctave/array/Array-C.cc        Sat Jan 24 22:27:12 2015 -0800
+++ b/liboctave/array/Array-C.cc        Mon Jan 26 15:31:14 2015 -0800
@@ -46,8 +46,8 @@ nan_ascending_compare (const Complex& x,
 {
   return (xisnan (y)
           ? ! xisnan (x)
-          : ((std::abs (x) < std::abs (x))
-             || ((std::abs (x) == std::abs (x)) && (arg (x) < arg (x)))));
+          : ((std::abs (x) < std::abs (y))
+             || ((std::abs (x) == std::abs (y)) && (arg (x) < arg (y)))));
 }
 
 static bool
@@ -55,8 +55,8 @@ nan_descending_compare (const Complex& x
 {
   return (xisnan (x)
           ? ! xisnan (y)
-          : ((std::abs (x) > std::abs (x))
-             || ((std::abs (x) == std::abs (x)) && (arg (x) > arg (x)))));
+          : ((std::abs (x) > std::abs (y))
+             || ((std::abs (x) == std::abs (y)) && (arg (x) > arg (y)))));
 }


This has been fixed on the development branch in this changeset
(http://hg.savannah.gnu.org/hgweb/octave/rev/884e0c55d92c).  The reporter will
need to build from Mercurial sources in order to see the fix.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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