MadelineProto/sqr.php
2016-07-30 10:14:47 -04:00

17 lines
278 B
PHP

<?php
function mysqr($n)
{
$guess = $n / 2;
while (true) {
$last = $guess;
$guess = (($n / $guess) + $guess) / 2;
if ($last == $guess) {
break;
}
}
return $guess;
}
var_dump(mysqr(234892482328), sqrt(234892482328));