]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/primes/solovay-strassen/solovay-strassen.factor
factor: trim using lists
[factor.git] / extra / math / primes / solovay-strassen / solovay-strassen.factor
index 3daad08e6f29b61a45803be6a65ff206be986c38..4313d349b64aa7aa1e482550ad8c499f23123910 100644 (file)
@@ -1,22 +1,22 @@
 ! Copyright (C) 2014 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: combinators kernel locals math math.extras
-math.extras.private math.functions math.ranges random sequences ;
+USING: combinators kernel math math.extras math.extras.private
+math.functions ranges random sequences ;
 
 IN: math.primes.solovay-strassen
 
 <PRIVATE
 
 :: (solovay-strassen) ( n numtrials -- ? )
-    numtrials iota [
+    numtrials <iota> [
         drop
-        n 1 - [1,b) random :> a
+        n 1 - [1..b) random :> a
         a n simple-gcd 1 > [ t ] [
             a n jacobi n mod'
             a n 1 - 2 /i n ^mod = not
         ] if
-    ] any? not ;
+    ] none? ;
 
 PRIVATE>