textbased-programms/newton-method-sqrt.js
@@ -5,7 +5,7 @@ import {terminal} from "./dfhi.js"; window.main = function(...argv) { window.main = (...argv) => { const testData = [0, 1.25, 3.758, 4.229, 6.735, 123456.789, (1<<30) + 1]; for(const c of testData) { const cquad = c*c; @@ -15,7 +15,7 @@ } }; function sqrt(c) { const sqrt = (c) => { const EPSILON = 1E-16; let xn = c; let q = c/xn; // auxiliary variable to avoid multiple division c/xn