From bfbe6edde68a32128a2f541442a9009381fb684f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 24 Mar 2013 01:08:28 -0700 Subject: [PATCH] math.statistics: Median now changes the order of the sequence, so clone it first. --- basis/math/statistics/statistics.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/basis/math/statistics/statistics.factor b/basis/math/statistics/statistics.factor index 90a7fcadc5..68800d9590 100644 --- a/basis/math/statistics/statistics.factor +++ b/basis/math/statistics/statistics.factor @@ -151,6 +151,7 @@ PRIVATE> bi kth-smallests first2 ; : median ( seq -- x ) + clone dup length odd? [ lower-median ] [ medians + 2 / ] if ; ! quantile can be any n-tile. quartile is n = 4, percentile is n = 100