PHP Classes

PHP Prime Number Test: Check if a number is prime in several ways

Recommend this page to a friend!
  Info   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 223 This week: 1All time: 8,219 This week: 350Up
Version License PHP version Categories
prime-tester 1.0GNU General Publi...5.3Algorithms, PHP 5, Math
Description 

Author

This class can check if a number is prime in several ways.

It can take a given number and check if it is prime using different methods.

Currently it tests the numbers using the methods: Standard test, Miller-Robin, Fermat Littler Theorem and GMP Library.

The class can also find the next and previous prime numbers near a given number.

Innovation Award
PHP Programming Innovation award nominee
August 2013
Number 6
Prime numbers are numbers that have special properties and are useful for several types of math operations and algorithms.

This class can help not only checking if a number is prime using several possible algorithms, but also can find the next and the previous prime number near a given number.

Manuel Lemos
Picture of Carlos Sosa
  Performance   Level  
Name: Carlos Sosa <contact>
Classes: 5 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 1x

Details

Prime tester class ================== This class check if number is prime. Using: - Standard test - Miller-Robin - Fermat Littler Theorem - GMP Library

  Files folder image Files  
File Role Description
Files folder imageException (1 file)
Files folder imageTest (5 files)
Plain text file index.php Example Example script
Plain text file LICENSE Data Auxiliary data
Plain text file PrimeTester.php Class Class source
Plain text file prime_list.php Example Example script
Plain text file prime_next.php Example Example script
Plain text file README.md Data Documentation
Plain text file RESULTS Output Sample output

  Files folder image Files  /  Exception  
File Role Description
  Plain text file FailRequirementException.php Class Class source

  Files folder image Files  /  Test  
File Role Description
  Plain text file FermatLittleTheoremTest.php Class Class source
  Plain text file GMPLibraryTest.php Class Class source
  Plain text file MillerRobinTest.php Class Class source
  Plain text file SimpleTest.php Class Class source
  Plain text file TestInterface.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:223
This week:1
All time:8,219
This week:350Up
User Comments (1)
good
10 years ago (Rahul Shambharkar)
70%StarStarStarStar