]> gitweb.factorcode.org Git - factor.git/commitdiff
math.statistics: minor style cleanup.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 11 Jul 2012 00:03:01 +0000 (17:03 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 11 Jul 2012 00:03:01 +0000 (17:03 -0700)
basis/math/statistics/statistics.factor

index 4fb282ad0594990c129a6a6ca4dc1b83ee301764..ac414e8b2dc952d5ee710e546dfb822d04d72e24 100644 (file)
@@ -94,7 +94,7 @@ PRIVATE>
 PRIVATE>
 
 : kth-object ( seq k quot: ( x y -- ? ) -- elt )
-    [ [ nth ] [ exchange ] ] dip (kth-object) ; inline    
+    [ [ nth ] [ exchange ] ] dip (kth-object) ; inline
 
 : kth-objects ( seq kths quot: ( x y -- ? ) -- elts )
     [ clone ] 2dip
@@ -142,8 +142,7 @@ PRIVATE>
     bi kth-smallests first2 ;
 
 : median ( seq -- x )
-    dup length odd?
-    [ lower-median ] [ medians + 2 / ] if ;
+    dup length odd? [ lower-median ] [ medians + 2 / ] if ;
 
 ! quantile can be any n-tile. quartile is n = 4, percentile is n = 100
 ! a,b,c,d parameters, N - number of samples, q is quantile (1/2 for median, 1/4 for 1st quartile)