From f3ff222c71b202e60a5bc8a2cbd6d16000025bc9 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 5 Dec 2014 11:53:13 +0100 Subject: [PATCH] FREQUENCIES: Fix bug when combining HISTOGRAM with PERCENTILES. This bug was reported only on windows, but had the potential to affect any system. Thanks to "Dr. Yaron Ghilay" for reporting the bug, and to Kai.Borgolte@gmx.de for diagnosing it. --- src/language/stats/frequencies.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/language/stats/frequencies.c b/src/language/stats/frequencies.c index b2253e311d..17e0313092 100644 --- a/src/language/stats/frequencies.c +++ b/src/language/stats/frequencies.c @@ -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); } -- 2.30.2