Skip to content

A PyPi package that tests to see if a number is prime using the Rabin-Miller primality test

License

Notifications You must be signed in to change notification settings

tobyck/prime-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prime_test

This module provides the function test(n) that returns True if n is a prime number, and False if it is composite (note that this test is probabilistic so that it can test extremely large numbers very fast for RSA). The function also has an optional variable k (defaults to 40) which is the iterations of the test, more information on that can be found here. Below is an example of how to use the module. Intall using pip install prime_test

from prime_test import prime
print(prime.test(167))
# prints True

(And I made in four other languages just becasue why not)

About

A PyPi package that tests to see if a number is prime using the Rabin-Miller primality test

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published