]> gitweb.factorcode.org Git - factor.git/commitdiff
fix seed-random for cmwc
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 8 Oct 2009 01:25:00 +0000 (20:25 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 8 Oct 2009 01:25:00 +0000 (20:25 -0500)
extra/random/cmwc/cmwc-tests.factor
extra/random/cmwc/cmwc.factor

index 2a908c0bd321572919c2467d3b405d0ef0066cc8..6e3f4ac178c741c3ae72341b346c9529a78b1956 100644 (file)
@@ -24,7 +24,7 @@ IN: random.cmwc.tests
 }
 ] [
     cmwc-4096
-    4096 iota >array seed-random [
+    4096 iota >array 362436 <cmwc-seed> seed-random [
         10 [ random-32 ] replicate
     ] with-random
 ] unit-test
@@ -35,7 +35,7 @@ IN: random.cmwc.tests
             10 [ random-32 ] replicate
         ] with-random
     ] [
-        4096 iota >array 362436 <cmwc-seed seed-random [
+        4096 iota >array 362436 <cmwc-seed> seed-random [
             10 [ random-32 ] replicate
         ] with-random
     ] bi =
index 104046821fda903108c262bb8a8e12fbbcb63fa3..00258257be702302173f26f15a726eb504a55c53 100644 (file)
@@ -48,4 +48,7 @@ M:: cmwc random-32* ( cmwc -- n )
 : cmwc-4096 ( -- cmwc )
     4096
     [ 18782 4294967295 362436 <cmwc> ]
-    [ '[ [ random-32 ] replicate ] with-system-random seed-random ] bi ;
+    [
+        '[ [ random-32 ] replicate ] with-system-random
+        362436 <cmwc-seed> seed-random
+    ] bi ;