From a9b1f8994f1912cedc602915007d470131c7b83b Mon Sep 17 00:00:00 2001 From: Rak Laptudirm <68542775+raklaptudirm@users.noreply.github.com> Date: Sun, 30 May 2021 17:04:24 +0530 Subject: [PATCH] chore(SquareRoot.js): Better Precision constant --- Maths/SquareRoot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maths/SquareRoot.js b/Maths/SquareRoot.js index be70502da..a5a710836 100644 --- a/Maths/SquareRoot.js +++ b/Maths/SquareRoot.js @@ -6,7 +6,7 @@ * Finding the square root of a number using Newton's method. */ -function sqrt (num, precision = 10) { +function sqrt (num, precision = 4) { if (!Number.isFinite(num)) { throw new TypeError(`Expected a number, received ${typeof num}`) } if (!Number.isFinite(precision)) { throw new TypeError(`Expected a number, received ${typeof precision}`) } let sqrt = 1