Safe Haskell | Safe-Infered |
---|
A module providing functions to test for primality, and find next and previous primes.
Documentation
isMillerRabinPrime :: (Integral a, Random a) => a -> BoolSource
isPrime :: Integer -> BoolSource
Is this number prime? The algorithm consists of using trial division to test for very small factors, followed if necessary by the Miller-Rabin probabilistic test.