note 54714 added to function.sqrt
| From: | phpNOSPAMatprimezerodotcom at osu1 dot php dot net | Date: | Wed, 13 Jul 2005 14:15:06 +0000 |
| Subject: | note 54714 added to function.sqrt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91896@lists.php.net to get a copy of this message | ||
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);
?>
----
Manual Page -- http://www.php.net/manual/en/function.sqrt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54714
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54714&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54714&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54714&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54714&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54714&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54714&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54714&report=yes
Search -- http://master.php.net/manage/user-notes.php