Safe Haskell | None |
---|---|
Language | Haskell98 |
Math.NumberTheory.Prime
Description
A module providing functions to test for primality, and find next and previous primes.
Synopsis
- primes :: [Integer]
- isTrialDivisionPrime :: Integer -> Bool
- isMillerRabinPrime :: (Integral a, Random a) => a -> Bool
- isPrime :: Integer -> Bool
- notPrime :: Integer -> Bool
- prevPrime :: Integer -> Integer
- nextPrime :: Integer -> Integer
Documentation
isTrialDivisionPrime :: Integer -> Bool Source #
isMillerRabinPrime :: (Integral a, Random a) => a -> Bool Source #
isPrime :: Integer -> Bool Source #
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.