do not try to sort %nan and %nan 74/18974/2
Antoine ELIAS [Thu, 26 Jan 2017 15:20:57 +0000 (16:20 +0100)]
b = gsort([1 2 %nan 1 3 %nan 2 3],"g","d");

Change-Id: Ieb173a8d35279c245458f75947a29df85f5eb332

scilab/modules/elementary_functions/src/cpp/gsort.cpp

index ed7bab5..efa7794 100644 (file)
@@ -49,6 +49,11 @@ bool descendent (T left, T right)
 {
     if (ISNAN((double)left))
     {
+        if (ISNAN((double)right))
+        {
+            return false;
+        }
+
         return true;
     }