Expand description
Check some primality-related properties of numbers.
This crate is designed to be used via primal
.
Functionsยง
- as_
perfect_ power - Returns integers
(y, k)
such thatx = y^k
withk
maximised (other than forx = 0, 1
, in which casey = x
,k = 1
). - as_
prime_ power - Return
Some((p, k))
ifx = p^k
for some primep
andk >= 1
(that is, including whenx
is itself a prime). - miller_
rabin - Test if
n
is prime, using the deterministic version of the Miller-Rabin test.