primes

Package for doing with primes. Implemented in C
Download

primes Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Vojtech Rylko
  • Publisher web site:
  • http://seznam.cz

primes Tags


primes Description

Package for doing with primes. Implemented in C primes is a collection of number theoretic functions for doing with primes in Python implemented in C and GMP.Including * unit tests * c sources * setup.py - distutils install scriptMethods * is_prime object -> bool Use Miller-Rabin primality test for Longs and huge Ingeters. For small Integers use naive method. For no-Long and no-Integer objects return always False.Installationpython setup.py installUsageis_prime>>> import primes>>> primes.is_prime(7)True>>> primes.is_prime(8)False>>> primes.is_prime("hello")False>>> primes.is_prime(3984538070834098342598340893489340850347598349832084567311L)True Requirements: · Python · GMP - GNU Multiple Precision Arithmetic Library What's New in This Release: · implementation of method id_mersenne_prime()


primes Related Software