@algorithm.ts/gcd 2.0.13 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/types/index.d.ts +6 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<header>
|
|
2
2
|
<h1 align="center">
|
|
3
|
-
<a href="https://github.com/guanghechen/algorithm.ts/tree/
|
|
3
|
+
<a href="https://github.com/guanghechen/algorithm.ts/tree/release-2.x.x/packages/gcd#readme">@algorithm.ts/gcd</a>
|
|
4
4
|
</h1>
|
|
5
5
|
<div align="center">
|
|
6
6
|
<a href="https://www.npmjs.com/package/@algorithm.ts/gcd">
|
|
@@ -107,5 +107,5 @@ A typescript implementation of the **gcd** and **Extended Euclidean** algorithm.
|
|
|
107
107
|
* [数论基础之模方程初步][gcd]
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
[homepage]: https://github.com/guanghechen/algorithm.ts/tree/
|
|
110
|
+
[homepage]: https://github.com/guanghechen/algorithm.ts/tree/release-2.x.x/packages/gcd#readme
|
|
111
111
|
[gcd]: https://me.guanghechen.com/post/math/number-theory/%E6%A8%A1%E6%96%B9%E7%A8%8B/basic/
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param y
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare function gcd(x: number, y: number): number;
|
|
9
9
|
/**
|
|
10
10
|
* Bigint version.
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@ export declare function gcd(x: number, y: number): number;
|
|
|
13
13
|
* @param y
|
|
14
14
|
* @returns
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
declare function gcdBigint(x: bigint, y: bigint): bigint;
|
|
17
17
|
/**
|
|
18
18
|
* Extended Euclidean algorithm for solving the smallest
|
|
19
19
|
* integer solution (|x| + |y| smallest) of the equation `Ax + By = gcd(x,y)`.
|
|
@@ -23,7 +23,7 @@ export declare function gcdBigint(x: bigint, y: bigint): bigint;
|
|
|
23
23
|
* @returns
|
|
24
24
|
* @see https://me.guanghechen.com/post/math/number-theory/%E6%A8%A1%E6%96%B9%E7%A8%8B/basic/
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
declare function euclidean(a: number, b: number): [number, number, number];
|
|
27
27
|
/**
|
|
28
28
|
* Bigint version.
|
|
29
29
|
*
|
|
@@ -32,4 +32,6 @@ export declare function euclidean(a: number, b: number): [number, number, number
|
|
|
32
32
|
* @returns
|
|
33
33
|
* @see https://me.guanghechen.com/post/math/number-theory/%E6%A8%A1%E6%96%B9%E7%A8%8B/basic/
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
declare function euclideanBigint(a: bigint, b: bigint): [bigint, bigint, bigint];
|
|
36
|
+
|
|
37
|
+
export { euclidean, euclideanBigint, gcd, gcdBigint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algorithm.ts/gcd",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "GCD + Euclidean algorithm",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "guanghechen",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/guanghechen/algorithm.ts.
|
|
11
|
+
"url": "https://github.com/guanghechen/algorithm.ts/tree/release-2.x.x",
|
|
12
12
|
"directory": "packages/gcd"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://github.com/guanghechen/algorithm.ts/tree/
|
|
14
|
+
"homepage": "https://github.com/guanghechen/algorithm.ts/tree/release-2.x.x/packages/gcd#readme",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"algorithm",
|
|
17
17
|
"gcd",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js",
|
|
39
|
-
"prebuild": "rimraf lib/
|
|
39
|
+
"prebuild": "rimraf lib/",
|
|
40
40
|
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
|
|
41
41
|
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "53a24624195c9f09422c9769c552f9066bc22c70"
|
|
44
44
|
}
|