Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how does square root work javascript

let sqrt = (c, depth = 100, x = 1) =>
    depth <= 0 ? x :
    sqrt(c, depth - 1, x - (Math.pow(x, 2) - c)/(2*x))

console.log(sqrt(2));
Source by learn.coderslang.com #
 
PREVIOUS NEXT
Tagged: #square #root #work #javascript
ADD COMMENT
Topic
Name
4+9 =