Hong-Phuc Bui
2025-01-16 2889de7f0c2d587a17fbd322af57c29e84238620
textbased-programms/newton-method-sqrt.js
@@ -6,11 +6,11 @@
import {terminal} from "./dfhi.js";
window.main = function(...argv) {
   let testData = [0, 1.25, 3.758, 4.229, 6.735, 123456.789, (1<<30) + 1];
   for(let c of testData) {
      let cquad = c*c;
      let csqrt = sqrt(cquad);
      let msqrt = Math.sqrt(cquad);
   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;
      const csqrt = sqrt(cquad);
      const msqrt = Math.sqrt(cquad);
      terminal.printl({"quadrat": cquad, "sqrt":csqrt, "Math.sqrt":msqrt, "expected": c})
   }
};