]> gitweb.factorcode.org Git - factor.git/commitdiff
math.statistics: use if-zero in mean-ddof.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 10 Jun 2014 20:06:42 +0000 (13:06 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 10 Jun 2014 20:06:42 +0000 (13:06 -0700)
basis/math/statistics/statistics.factor

index 950df958ebd0a930e6d10981f7c646c7c57dccfc..5a618ea168c9d98a939d71ced035e1025f44f337 100644 (file)
@@ -12,7 +12,7 @@ IN: math.statistics
 ! Delta in degrees-of-freedom
 : mean-ddof ( seq ddof -- x )
     [ [ sum ] [ length ] bi ] dip -
-    dup zero? [ 2drop 0 ] [ / ] if ; inline
+    [ drop 0 ] [ / ] if-zero ; inline
 
 : mean ( seq -- x )
     0 mean-ddof ; inline