note 54714 deleted from function.sqrt by tularis
| From: | tularis@php.net | Date: | Thu, 16 Feb 2012 16:33:38 +0000 |
| Subject: | note 54714 deleted from function.sqrt by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186174@lists.php.net to get a copy of this message | ||
Note Submitter: php NOSPAM at primezero dot com
----
creating perfect squares... (no decimals)
<?
# initial value
$i = 0;
#set any limit you want
$setSomeLimit = 10000;
# do it! .... do it! ... do it!
do {
# find the square root
$sqRoot = sqrt($i);
# not a decimal? that it is a perfect square! ^_^
if ( ereg ("^[0-9]{1,12}$", $sqRoot)) {
# suppose that the_square_root = teh_square_root
print "<br>perfect_square_root is of $i is $sqRoot";
}
$i++; # next!!
# keeps running until it reaches the limit
} while ($i < $setSomeLimit);
?>