FREQUENCIES: Fix bug when combining HISTOGRAM with PERCENTILES.
[pspp] / src / language / stats / frequencies.c
index b2253e311d11341e9626b5f8d7541bd0ab1eb062..17e03130923bab5888580f0493d39f8decd712e3 100644 (file)
@@ -82,6 +82,14 @@ ptile_3way (const void *_p1, const void *_p2)
   if (p1->p < p2->p)
     return -1;
 
+  if (p1->p == p2->p)
+    {
+      if (p1->show > p2->show)
+       return -1;
+
+      return (p1->show < p2->show);
+    }
+
   return (p1->p > p2->p);
 }