| | |
| | | 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}) |
| | | } |
| | | }; |