]> gitweb.factorcode.org Git - factor.git/commitdiff
error message
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 25 Apr 2008 05:25:37 +0000 (00:25 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 25 Apr 2008 05:25:37 +0000 (00:25 -0500)
extra/math/miller-rabin/miller-rabin.factor

index 7835277b9b2fde1110f13f3082dc3315f0064b5e..a1f90d74c970e575a99957afd501e018e5b340c1 100755 (executable)
@@ -1,4 +1,4 @@
-USING: combinators combinators.lib io locals kernel math
+eSING: combinators combinators.lib io locals kernel math
 math.functions math.ranges namespaces random sequences
 hashtables sets ;
 IN: math.miller-rabin
@@ -76,7 +76,9 @@ TUPLE: miller-rabin-bounds ;
 : find-relative-prime ( n -- p )
     dup random find-relative-prime* ;
 
+ERROR: too-few-primes ;
+
 : unique-primes ( numbits n -- seq )
     #! generate two primes
-    over 5 < [ "not enough primes below 5 bits" throw ] when
+    over 5 < [ too-few-primes ] when
     [ [ drop random-prime ] with map ] [ all-unique? ] generate ;