Safe Haskell | Safe-Infered |
---|
A module providing functions to test for primality, and find next and previous primes.
- isTrialDivisionPrime :: Integer -> Bool
- primes :: [Integer]
- pfactors1 :: Integer -> [Integer]
- isStrongPseudoPrime :: Integral a => a -> a -> Bool
- isStrongPseudoPrime' :: (Integral a1, Integral a) => a1 -> (Int, a) -> a1 -> Bool
- split2s :: (Integral t1, Num t) => t -> t1 -> (t, t1)
- power_mod :: (Integral a1, Integral a) => a -> a1 -> a -> a
- isMillerRabinPrime' :: (Integral a, Random a) => a -> IO Bool
- isMillerRabinPrime :: (Integral a, Random a) => a -> Bool
- isPrime :: Integer -> Bool
- notPrime :: Integer -> Bool
- prevPrime :: Integer -> Integer
- nextPrime :: Integer -> Integer
- pfactors2 :: Integer -> [Integer]
Documentation
isStrongPseudoPrime :: Integral a => a -> a -> BoolSource
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.
prevPrime :: Integer -> IntegerSource
Given n, prevPrime n
returns the greatest p, p < n, such that p is prime