PHP Classes

Is Prime: Check whether a number is prime

Recommend this page to a friend!
  Info   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 358 All time: 6,919 This week: 120Up
Version License PHP version Categories
is-prime 1.0BSD License5.0PHP 5, Math


This class can check whether a number is prime.

It first checks if the number is divisible by small prime integers.

If it passes the low prime numbers check, the class checks if the number ends with a digit that all higher prime numbers end.

On the final step it checks if the number is divisible by any of the prime numbers that are found incrementally.

Picture of Ahmad Retha
Name: Ahmad Retha <contact>
Classes: 4 packages by
Country: United Kingdom
Age: ???
All time rank: 210194 in United Kingdom
Week rank: 93 Up3 in United Kingdom Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Accessible without login Plain text file IsPrime.php Class IsPrime PHP Class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,919
This week:120Up