Crate primal_check [] [src]

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 that x = y^k with k maximised (other than for x = 0, 1, in which case y = x, k = 1).

as_prime_power

Return Some((p, k)) if x = p^k for some prime p and k >= 1 (that is, including when x is itself a prime).

miller_rabin

Test if n is prime, using the deterministic version of the Miller-Rabin test.