Skip to content

Commit 674e54b

Browse files
committed
Added gcd function
1 parent b8bd32a commit 674e54b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/math/greatest-common-divisor/greatest-common-divisor.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/**
2-
* Returns greatest common divider from number using iterative Euclid's algorithm
2+
* Returns greatest common divider of two numbers
3+
* using iterative Euclid's algorithm
4+
*
35
* @link https://en.wikipedia.org/wiki/Euclidean_algorithm
46
*
5-
* Iterative algorithm much faster (in average ~1.335) than recursive
7+
* Iterative algorithm much faster
8+
* in average ~1.335 (own benchmarks)
9+
* than recursive
610
*
711
* @param {number} a
812
* @param {number} b

0 commit comments

Comments
 (0)