Skip to content

Commit a9b1f89

Browse files
authored
chore(SquareRoot.js): Better Precision constant
1 parent 4ed05e2 commit a9b1f89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Maths/SquareRoot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Finding the square root of a number using Newton's method.
77
*/
88

9-
function sqrt (num, precision = 10) {
9+
function sqrt (num, precision = 4) {
1010
if (!Number.isFinite(num)) { throw new TypeError(`Expected a number, received ${typeof num}`) }
1111
if (!Number.isFinite(precision)) { throw new TypeError(`Expected a number, received ${typeof precision}`) }
1212
let sqrt = 1

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy