]> gitweb.factorcode.org Git - factor.git/commitdiff
math.finance: Removing an instance of "spin".
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 5 Sep 2010 00:20:15 +0000 (17:20 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 10 Sep 2010 20:30:01 +0000 (13:30 -0700)
extra/math/finance/finance-tests.factor
extra/math/finance/finance.factor

index fc4ad0d07e928244d253fd5fa257be263c933d79..eb4b238f6157416ca30f3a1bf0124b5dea77485e 100644 (file)
@@ -2,6 +2,8 @@ USING: kernel math math.functions math.finance tools.test ;
 
 IN: math.finance.tests
 
+[ { 1 2 3 4 } ] [ { 1 2 3 4 5 } 1 ema ] unit-test
+
 [ { 2 4 } ] [ { 1 3 5 } 2 sma ] unit-test
 
 [ { 1 3 1 } ] [ { 1 3 2 6 3 } 2 momentum ] unit-test
index f1c608bad912017f37f4afce36f527952f61544c..12f58c891bf9a2fd79a3f138fe2f0b055cde2bd8 100644 (file)
@@ -15,7 +15,7 @@ IN: math.finance
 PRIVATE>
 
 : ema ( seq n -- newseq )
-    a swap unclip [ [ dup ] 2dip spin weighted ] accumulate 2nip ;
+    a swap unclip [ swap pick weighted ] accumulate 2nip ;
 
 : sma ( seq n -- newseq )
     clump [ mean ] map ;