! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax kernel sequences math ;
+USING: help.markup help.syntax kernel math
+math.primes.miller-rabin ;
IN: math.primes.miller-rabin
HELP: miller-rabin
{ $values
{ "n" integer }
- { "?" "a boolean" }
+ { "?" boolean }
}
{ $description "Returns true if the number is a prime. Calls " { $link miller-rabin* } " with a default of 10 Miller-Rabin tests." } ;
HELP: miller-rabin*
{ $values
{ "n" integer } { "numtrials" integer }
- { "?" "a boolean" }
+ { "?" boolean }
}
{ $description "Performs " { $snippet "numtrials" } " trials of the Miller-Rabin probabilistic primality test algorithm and returns true if prime." } ;