标签: javascript
function sqrt(n){
let approx = n/2; // Start with some or other guess at the answer let better = (approx + n/approx)/2; while (Math.abs(approx - better) > .001) { approx = better; better = (approx + n/approx)/2.0;
}
返回更好;