Applied fixes from StyleCI
This commit is contained in:
parent
9e08e6fe8f
commit
637c40fb60
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…
x
Reference in New Issue
Block a user