Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- repeatedSquare :: Multiplicative r => r -> Natural -> r
- modPow :: (Integral a, Euclidean r) => r -> r -> a -> r
- fermatTest :: MonadRandom m => Integer -> m PrimeResult
- isPseudoPrime :: MonadRandom m => Integer -> m (Either Integer Bool)
Documentation
repeatedSquare :: Multiplicative r => r -> Natural -> r Source #
Calculates n
-th power efficiently, using repeated square method.
fermatTest :: MonadRandom m => Integer -> m PrimeResult Source #
Fermat-test for pseudo-primeness.