mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 10:38:59 +01:00
Merge branch 'master' of https://github.com/danog/MadelineProto
This commit is contained in:
commit
5c0c0909ed
9
sqr.php
9
sqr.php
@ -1,13 +1,16 @@
|
||||
<?php
|
||||
function mysqr($n) {
|
||||
|
||||
function mysqr($n)
|
||||
{
|
||||
$guess = $n / 2;
|
||||
while (true) {
|
||||
$last = $guess;
|
||||
$guess = (($n / $guess) + $guess) / 2;
|
||||
if($last == $guess) {
|
||||
if ($last == $guess) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $guess;
|
||||
}
|
||||
var_dump(mysqr(234892482328),sqrt(234892482328));
|
||||
var_dump(mysqr(234892482328), sqrt(234892482328));
|
||||
|
Loading…
Reference in New Issue
Block a user