Update index.js
This commit is contained in:
parent
a80c3334a3
commit
97d5446425
1 changed files with 5 additions and 9 deletions
14
index.js
14
index.js
|
@ -13,16 +13,12 @@ function fisqrt(number) {
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
//manual sqrt
|
//square
|
||||||
function msqrt(number) {
|
function sq(n1, n2) {
|
||||||
for (var i = 0; i * i <= number; i++) {
|
return n1 * n2;
|
||||||
if (i * i === number)
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
return number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//square
|
//square self
|
||||||
function sq(number) {
|
function sqs(number) {
|
||||||
return number * number;
|
return number * number;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue