[][src]Function red_primality::is_u64_prime

pub fn is_u64_prime(n: u64) -> bool

Determines if the given parameter is prime.

The Miller-Rabin primality test can be said to have two results: "Not Prime" or "Probably Prime". So in general, this test cannot deterministically guarantee primality. It is possible (though progressively less likely the more tests are applied) that an exceptionally unlikely composite could be pronounced as prime by any sequence of tests.

However, it has been proven that certain small combinations of Miller-Rabin tests do not have any exceptions under certainn lower bounds. This function uses these vetted combinations of tests to efficiently and determinstically determine primality for all integers inn the u64 range.

See Wikipedia for more details.