PHP Classes

The member function list_prime() will hang up owing to a typi...

Recommend this page to a friend!

      Prime numbers  >  All threads  >  The member function list_prime()...  >  (Un) Subscribe thread alerts  
Subject:The member function list_prime()...
Summary:Package rating comment
Messages:2
Author:CPK Smithies
Date:2012-12-22 21:35:58
Update:2012-12-25 08:37:37
 

CPK Smithies rated this package as follows:

Utility: Insufficient
Consistency: Insufficient

  1. The member function list_prime()...   Reply   Report abuse  
Picture of CPK Smithies CPK Smithies - 2012-12-22 21:35:58
The member function list_prime() will hang up owing to a typing error. There is no obvious need for the "eratostene" array to be a class member. There is a public class variable and a public class function (method) with the same name. Three member functions do the same thing (maybe should be members of different classes). Static class member functions not declared static. Class not well-designed; not sure what sort of thing an instance would be or what use it would have.

  2. Re: The member function list_prime()...   Reply   Report abuse  
Picture of catalin catalin - 2012-12-25 08:37:37 - In reply to message 1 from CPK Smithies
You are right mainly.
This class was builded for educational purposes: to see differences between various algorithms, so i needed to be one class. Of course, if you need to build a list of prime numbers you need only one method - atkin.