Login   Register  
PHP Classes
elePHPant
Icontem

File: math_prime_test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of bobak  >  Math prime  >  math_prime_test.php  >  Download  
File: math_prime_test.php
Role: Example script
Content type: text/plain
Description: exemple & test
Class: Math prime
Determine whether a number is prime
Author: By
Last change: Example
Date: 2008-04-19 19:02
Size: 816 bytes
 

Contents

Class file image Download
<?php
/*
 _____                    ______ _   _ ______
|  __ \                   | ___ \ | | || ___ \
| |  \/_ __ ___  ___ _ __ | |_/ / |_| || |_/ /
| | __| '__/ _ \/ _ \ '_ \|  __/|  _  ||  __/
| |_\ \ | |  __/  __/ | | | |   | | | || |
 \____/_|  \___|\___|_| |_\_|   \_| |_/\_|
----------------------------------------------
(C)BOBAK 2008                             V4.0
----------------------------------------------
web   : http://www.greenphp.com
email : bobak@greenphp.com
----------------------------------------------
*/

/**
 * Check a number if prime : tests
 *
 * @author Bobak
 * @package math
 * @subpackage prime
 */

require_once('math_prime.php');

echo 
"First prims of 2^16<BR><BR>";

for (
$i=1;$i<65536;$i++)
   {
   if (
math_prime::test($i)) {echo "$i ";}
   }
?>