Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: DeCap
  • Order by date
  1. DeCap

    prime number function

    And technically by wich number other than 1 can 1 be divided to give an integer ? For the benchmark it's right they should be compared on the same server. If you want to do so on your own server just follow these instructions for my program : (1) Create the "prime_numbers.php" file and import...
  2. DeCap

    prime number function

    The difference between our algorithms can only be seen on very large numbers. I modified my example to be similar to yours. Try on your page 23400000 to 23410000 (that is 10,000 !!!) and then try them on mine : http://denis.capart.free.fr/php/prime_numbers.php On yours the 30 secs...
  3. DeCap

    prime number function

    I did it !!! Here is the final "primes" function, it's incredibly fast. If you created the primes_inc.php as I showed previously just replace this function. Usage of the function is the same. ------ function primes( $n, $debug ) { global $prime_number; $result = ""; $root = floor( sqrt(...
  4. DeCap

    prime number function

    Sorry, I made a little mistake in the example, I forgot "$debug" argument in the call of the functions !!! ((=: I also forgot to say that "primes" function could be improved based on the hard coded primes table. I'll try to do it in a near future... if none of you does !!! (=; ------ <?PHP...
  5. DeCap

    prime number function

    This should do the job. I wrote it as an include file "primes_inc.php". First prime numbers are "hard coded" up to 100. The procedures extend (function "extend_primes") this table as needed if you ask numbers above "10,000". These functions check only modulos by prime numbers up to the square...

Part and Inventory Search

Back
Top