note 44390 added to function.sqrt
| From: | php at primezero dot com | Date: | Wed, 04 Aug 2004 15:57:33 +0000 |
| Subject: | note 44390 added to function.sqrt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73932@lists.php.net to get a copy of this message | ||
this little script allows you to find a whole lotta square roots...
<?
# initial value
$i = 0;
#set any limit you want, well, almost any...
$setSomeLimit = 10000;
# 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>teh_square_root is of $i is $sqRoot";
}
$i++; # next!!
# keeps running until it reaches the limit
} while ($i < $setSomeLimit);
# author: guru clockwise
# website: primezero.com
?>
----
Manual Page -- http://www.php.net/manual/en/function.sqrt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44390
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44390&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44390&report=yes
Search -- http://master.php.net/manage/user-notes.php