up previous next
prime integer test
This function determines whether a positive integer is prime; if N
is not positive, an error is signalled. This function may be extremely slow
when N is a large prime; in practice it is usually better to call
For the curious: currently, the function first performs a probabilistic check
(Miller-Rabin), if that passes, it then verifies primality (via Lucas test).