Skip to main content

Module primality

Module primality 

Source
Expand description

Primality checks and neighboring prime search.

Functionsยง

is_composite
Returns true when n is composite.
is_prime
Returns true when n is prime.
next_prime
Returns the smallest prime strictly greater than n.
previous_prime
Returns the largest prime strictly less than n.