]> gitweb.factorcode.org Git - factor.git/commitdiff
Statistics tests
authorDoug Coleman <erg@trifocus.net>
Wed, 26 Oct 2005 02:25:43 +0000 (02:25 +0000)
committerDoug Coleman <erg@trifocus.net>
Wed, 26 Oct 2005 02:25:43 +0000 (02:25 +0000)
Added USING: math-contrib

contrib/math/test.factor

index 80307d12578c6a0b7d2860f9419e14967b324ecb..496e75f70655b9b9d03699cf87349a0154807736 100644 (file)
@@ -1,5 +1,5 @@
 IN: temporary
-USING: kernel math test sequences ;
+USING: kernel math test sequences math-contrib ;
 
 ! Tests
 [ { 0 1 } ] [ { 0 1 0 0 } ptrim ] unit-test
@@ -206,3 +206,20 @@ unit-test
     
     m.
 ] unit-test
+
+[ 1 ] [ { 1 } mean ] unit-test
+[ 3/2 ] [ { 1 2 } mean ] unit-test
+
+[ 0 ] [ { 1 } range ] unit-test
+[ 89 ] [ { 1 2 30 90 } range ] unit-test
+[ 2 ] [ { 1 2 3 } median ] unit-test
+[ 5/2 ] [ { 1 2 3 4 } median ] unit-test
+
+[ 1 ] [ { 1 2 3 } var ] unit-test
+[ 1 ] [ { 1 2 3 } std ] unit-test
+
+[ t ] [ { 23.2 33.4 22.5 66.3 44.5 } std 18.1906 - .0001 < ] unit-test
+
+[ 0 ] [ { 1 } var ] unit-test
+[ 0 ] [ { 1 } std ] unit-test
+