Skip to main content

A collection of Python modules consisting different primality tests.

Project description

primeTester

primeTester is a collection of Python modules consisting different primality tests.

Link to package on PyPI: primeTester.

Tests Included

  • Fermat Test
  • Miller Rabin Test
  • Solovay Strassen
  • AKS Test
  • Trial Division

Install

pip3 install PrimeTester

Usage

Import the test function from the python modules installed. Camel case is used for the functions names.

from millerRabin import millerRabin

For probability based tests (Fermat, Miller Rabin, Solovay Strassen) those functions take in two arguments. The first argument takes in a number to be tested as prime, the second is the number of test iterations.

print(fermat(5,100))

All the test functions will return a true or false value. A returned true value indicates that the inputted number is a prime. A returned false value indicates that the inputted number is not a prime.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

primeTester-1.1.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

primeTester-1.1-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page