@algorithm.ts/gcd 3.0.0-alpha.8 → 3.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,405 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # 3.1.0 (2023-05-13)
7
+
8
+
9
+ ### Performance Improvements
10
+
11
+ * ⬆️ upgrade dependencies ([1ebc2c1](https://github.com/guanghechen/algorithm.ts/commit/1ebc2c167dcc4024d9552aacf5838e1ffc73e58f))
12
+
13
+
14
+
15
+ # 3.0.0 (2023-04-02)
16
+
17
+
18
+ ### Performance Improvements
19
+
20
+ * 🔧 add missing devDependencies ([69f6da4](https://github.com/guanghechen/algorithm.ts/commit/69f6da43cf1ecebac9f6bf8a7d8ffaced7f9de4c))
21
+ * 🔧 don't pack src/ folder into tarball file ([2dc61ad](https://github.com/guanghechen/algorithm.ts/commit/2dc61ad8c031cfc1ecf4f63c405d3e23eff1d9c9))
22
+ * 🔖 publish v3.0.0 ([9bb1f35](https://github.com/guanghechen/algorithm.ts/commit/9bb1f3515444890907c8e811b989f17073f39591))
23
+ * ⬆️ upgrade devDependencies ([e88a181](https://github.com/guanghechen/algorithm.ts/commit/e88a181201ea675715be11d165b0c49c0f9224b8))
24
+
25
+
26
+
27
+ # 3.0.0-alpha.8 (2023-03-11)
28
+
29
+
30
+ ### Performance Improvements
31
+
32
+ * 🔖 publish v3.0.0-alpha.8 ([104385f](https://github.com/guanghechen/algorithm.ts/commit/104385f40c0be99b843e3342e85b618761047b69))
33
+ * 🔧 update package entry ([fd4445a](https://github.com/guanghechen/algorithm.ts/commit/fd4445a0197b21b1d6cc157c543c1f59116c2cc5))
34
+ * ⬆️ upgrade devDependencies ([4aac0d0](https://github.com/guanghechen/algorithm.ts/commit/4aac0d0267b4050689e95902d081302131417ec5))
35
+
36
+
37
+
38
+ # 3.0.0-alpha.7 (2023-01-09)
39
+
40
+
41
+ ### Performance Improvements
42
+
43
+ * 🔖 publish v3.0.0-alpha.7 ([336c4da](https://github.com/guanghechen/algorithm.ts/commit/336c4da3b92a49804c60d0a6dfb783b14712ce0a))
44
+
45
+
46
+
47
+ # 3.0.0-alpha.6 (2023-01-07)
48
+
49
+
50
+ ### Performance Improvements
51
+
52
+ * 🔖 publish v3.0.0-alpha.6 ([1758289](https://github.com/guanghechen/algorithm.ts/commit/1758289e40e4d8786800b21aeed3525a572e89fe))
53
+ * 🔧 set engine node>=16.0.0 ([76e08d7](https://github.com/guanghechen/algorithm.ts/commit/76e08d7a410d437f83a84002c97892204c1fd5ca))
54
+
55
+
56
+
57
+ # 3.0.0-alpha.5 (2023-01-07)
58
+
59
+
60
+ ### Performance Improvements
61
+
62
+ * 🔖 publish v3.0.0-alpha.5 ([6c10d3c](https://github.com/guanghechen/algorithm.ts/commit/6c10d3c77bf342c7284a27e0fe07ce26fbdba05b))
63
+ * 🔧 set engine node>=16.15.1 ([464c990](https://github.com/guanghechen/algorithm.ts/commit/464c99062aeec99258c1a1e475570b549f63addb))
64
+
65
+
66
+
67
+ # 3.0.0-alpha.4 (2023-01-07)
68
+
69
+
70
+ ### Performance Improvements
71
+
72
+ * 🔖 publish v3.0.0-alpha.4 ([969d685](https://github.com/guanghechen/algorithm.ts/commit/969d68502c3c35690ed7aee86dde2fe60cddddfc))
73
+ * 🔧 update npm entries ([950e3ec](https://github.com/guanghechen/algorithm.ts/commit/950e3ec1d0c9ec3a53de613b9048b3442697404d))
74
+
75
+
76
+
77
+ # 3.0.0-alpha.3 (2023-01-04)
78
+
79
+
80
+ ### Performance Improvements
81
+
82
+ * 🔖 publish v3.0.0-alpha.3 ([d50b472](https://github.com/guanghechen/algorithm.ts/commit/d50b4725bde1b43474f490a29672db5aa1482ae3))
83
+ * 🔧 support dual esm/commonjs packages ([0f91fbf](https://github.com/guanghechen/algorithm.ts/commit/0f91fbf7c22d7778175ee833afdcf05df5dd34ba))
84
+
85
+
86
+
87
+ # 3.0.0-alpha.2 (2023-01-02)
88
+
89
+
90
+ ### Performance Improvements
91
+
92
+ * 🔖 publish v3.0.0-alpha.2 ([3d718fb](https://github.com/guanghechen/algorithm.ts/commit/3d718fba94605e2fd60a3056b502e2e1376ca0ed))
93
+ * ⬆️ upgrade dependencies ([2672a11](https://github.com/guanghechen/algorithm.ts/commit/2672a119246358d4589ae36bcabd044d395b6136))
94
+
95
+
96
+
97
+ # 3.0.0-alpha.1 (2022-11-13)
98
+
99
+
100
+ ### Performance Improvements
101
+
102
+ * 🔖 publish v3.0.0-alpha.1 ([8f9a0d0](https://github.com/guanghechen/algorithm.ts/commit/8f9a0d0dfee15efc08c4165848123b118c13ce81))
103
+
104
+
105
+
106
+ # 3.0.0-alpha.0 (2022-09-12)
107
+
108
+
109
+ ### Features
110
+
111
+ * ✨ refactor gcd ([3896501](https://github.com/guanghechen/algorithm.ts/commit/38965015cda108e8dfbcdd8e49dddbace923fca9))
112
+
113
+
114
+ ### Performance Improvements
115
+
116
+ * fix build error ([bbaa26f](https://github.com/guanghechen/algorithm.ts/commit/bbaa26fc2654a47438574c73997ab4e4fca7bc72))
117
+ * 🔖 publish v3.0.0-alpha.0 ([7562a90](https://github.com/guanghechen/algorithm.ts/commit/7562a908843d63b6b1bf92e7aa2104e7b294eaa0))
118
+
119
+
120
+
121
+ ## 2.0.14 (2022-08-27)
122
+
123
+
124
+ ### Performance Improvements
125
+
126
+ * 🔖 publish v2.0.14 ([53a2462](https://github.com/guanghechen/algorithm.ts/commit/53a24624195c9f09422c9769c552f9066bc22c70))
127
+ * 🔧 update build configs ([266538b](https://github.com/guanghechen/algorithm.ts/commit/266538bb6736e85c2439b706f11865425b570563))
128
+ * 📝 update repo link ([f0210ca](https://github.com/guanghechen/algorithm.ts/commit/f0210ca93780ed4109c90d4d337604a6b998b01b))
129
+
130
+
131
+
132
+ ## 2.0.13 (2022-06-26)
133
+
134
+
135
+ ### Performance Improvements
136
+
137
+ * 🔖 publish v2.0.13 ([ebd6447](https://github.com/guanghechen/algorithm.ts/commit/ebd6447586d9958adaff5218e91768eda82b5bec))
138
+
139
+
140
+
141
+ ## 2.0.12 (2022-06-07)
142
+
143
+
144
+ ### Performance Improvements
145
+
146
+ * 🔖 publish v2.0.12 ([cfc415a](https://github.com/guanghechen/algorithm.ts/commit/cfc415a6e56d76dcf795421d92dd81ac2a39a5fc))
147
+
148
+
149
+
150
+ ## 2.0.11 (2022-04-19)
151
+
152
+
153
+ ### Performance Improvements
154
+
155
+ * 🔖 publish v2.0.11 ([42feafd](https://github.com/guanghechen/algorithm.ts/commit/42feafd0303f51767aa7e498f6de84d9478c1dca))
156
+
157
+
158
+
159
+ ## 2.0.10 (2022-04-12)
160
+
161
+
162
+ ### Performance Improvements
163
+
164
+ * 🔖 publish v2.0.10 ([65694a5](https://github.com/guanghechen/algorithm.ts/commit/65694a5108c220d1edff9be57a12bf8c8403e14d))
165
+
166
+
167
+
168
+ ## 2.0.9 (2022-04-10)
169
+
170
+
171
+ ### Performance Improvements
172
+
173
+ * 🔖 publish v2.0.9 ([1bdac64](https://github.com/guanghechen/algorithm.ts/commit/1bdac6453d21e3cfeca2e65413e01aa720a34d38))
174
+
175
+
176
+
177
+ ## 2.0.8 (2022-04-10)
178
+
179
+
180
+ ### Performance Improvements
181
+
182
+ * 🔖 publish v2.0.8 ([7d92191](https://github.com/guanghechen/algorithm.ts/commit/7d921919d03570e772a847763100eb1a58d10d2d))
183
+
184
+
185
+
186
+ ## 2.0.8-alpha.0 (2022-04-05)
187
+
188
+
189
+ ### Performance Improvements
190
+
191
+ * 🔖 publish v2.0.8-alpha.0 ([24a301c](https://github.com/guanghechen/algorithm.ts/commit/24a301c145ad9f6c0e50494de39456c42bb02f29))
192
+
193
+
194
+
195
+ ## 2.0.7 (2022-04-03)
196
+
197
+
198
+ ### Performance Improvements
199
+
200
+ * 🔖 publish v2.0.7 ([814bc48](https://github.com/guanghechen/algorithm.ts/commit/814bc48415c5bbea555e0807b8a862cf348df5c1))
201
+
202
+
203
+
204
+ ## 2.0.7-alpha.1 (2022-04-03)
205
+
206
+
207
+ ### Performance Improvements
208
+
209
+ * 🔖 publish v2.0.7-alpha.1 ([fd487f4](https://github.com/guanghechen/algorithm.ts/commit/fd487f425bd3b8273a414ead8b697010fe1a3a83))
210
+
211
+
212
+
213
+ ## 2.0.7-alpha.0 (2022-03-27)
214
+
215
+
216
+ ### Performance Improvements
217
+
218
+ * 🔖 publish v2.0.7-alpha.0 ([8a89b2b](https://github.com/guanghechen/algorithm.ts/commit/8a89b2b68855a8eee6b244188792bd294e56045f))
219
+
220
+
221
+
222
+ ## 2.0.6 (2022-03-26)
223
+
224
+
225
+ ### Performance Improvements
226
+
227
+ * 🔖 publish v2.0.6 ([27a96ca](https://github.com/guanghechen/algorithm.ts/commit/27a96ca7e37b440880b5fd3be8bd1bd08939104e))
228
+
229
+
230
+
231
+ ## 2.0.5 (2022-03-23)
232
+
233
+
234
+ ### Performance Improvements
235
+
236
+ * 🔖 publish v2.0.5 ([b6f49a9](https://github.com/guanghechen/algorithm.ts/commit/b6f49a92024b9062f89a47277f692069e3abd9ec))
237
+
238
+
239
+
240
+ ## 2.0.4 (2022-03-20)
241
+
242
+
243
+ ### Performance Improvements
244
+
245
+ * 🔖 publish v2.0.4 ([1f37699](https://github.com/guanghechen/algorithm.ts/commit/1f37699b24bbf498fa820a44056c5f7b291308ee))
246
+
247
+
248
+
249
+ ## 2.0.3 (2022-02-24)
250
+
251
+
252
+ ### Performance Improvements
253
+
254
+ * 🔖 publish v2.0.3 ([bfd7ee8](https://github.com/guanghechen/algorithm.ts/commit/bfd7ee8420771cc02f7ef53833ba17780192cc88))
255
+
256
+
257
+
258
+ ## 2.0.2 (2022-02-24)
259
+
260
+
261
+ ### Performance Improvements
262
+
263
+ * 🔖 publish v2.0.2 ([386ea6e](https://github.com/guanghechen/algorithm.ts/commit/386ea6eef0154a42689f03c4943c526a1234db45))
264
+
265
+
266
+
267
+ ## 2.0.1 (2022-02-22)
268
+
269
+
270
+ ### Performance Improvements
271
+
272
+ * 🔖 publish v2.0.1 ([cac97b1](https://github.com/guanghechen/algorithm.ts/commit/cac97b1cbdc95e0c0914b24ea4e4d25e40bb15c5))
273
+
274
+
275
+
276
+ # 2.0.0 (2022-02-06)
277
+
278
+
279
+ ### Performance Improvements
280
+
281
+ * 🔖 publish v2.0.0 ([832e998](https://github.com/guanghechen/algorithm.ts/commit/832e998c72a5e2de64cdca52655e2f0456a17ba2))
282
+
283
+
284
+
285
+ # 2.0.0-alpha.0 (2022-02-05)
286
+
287
+
288
+ ### Performance Improvements
289
+
290
+ * :art: [BREAKING] refactor: add 'I' as prefix name for interface types ([7253441](https://github.com/guanghechen/algorithm.ts/commit/7253441870bd61579f644b47c64b9a50b169afc3))
291
+ * 🔖 publish v2.0.0-alpha.0 ([f48a558](https://github.com/guanghechen/algorithm.ts/commit/f48a558ad6decd6c5eee4b9a999ac085c9e19a22))
292
+
293
+
294
+
295
+ ## 1.0.24 (2022-01-22)
296
+
297
+
298
+ ### Performance Improvements
299
+
300
+ * 🔖 publish v1.0.24 ([be5ff5e](https://github.com/guanghechen/algorithm.ts/commit/be5ff5ef055a514bd2f9113b541e9f49ad6008b4))
301
+ * 🎨 set print width to 100 (old is 80) ([dd57d3f](https://github.com/guanghechen/algorithm.ts/commit/dd57d3f5b59edb82426bc84fbf687bfa08c8cfe4))
302
+
303
+
304
+
305
+ ## 1.0.23 (2021-11-28)
306
+
307
+
308
+ ### Performance Improvements
309
+
310
+ * 🔖 publish v1.0.23 ([cc85764](https://github.com/guanghechen/algorithm.ts/commit/cc8576431cceb414f18f481788d5df198deeb464))
311
+
312
+
313
+
314
+ ## 1.0.22 (2021-10-19)
315
+
316
+
317
+ ### Performance Improvements
318
+
319
+ * 🔖 publish v1.0.22 ([d4af2ac](https://github.com/guanghechen/algorithm.ts/commit/d4af2ac47f6a8d2a22eee8763be73b3770d4754d))
320
+
321
+
322
+
323
+ ## 1.0.21 (2021-10-07)
324
+
325
+
326
+ ### Performance Improvements
327
+
328
+ * 🔖 publish v1.0.21 ([610f21c](https://github.com/guanghechen/algorithm.ts/commit/610f21c513a5d0dce5afc2ad315a525c17300409))
329
+
330
+
331
+
332
+ ## 1.0.20 (2021-10-07)
333
+
334
+
335
+ ### Performance Improvements
336
+
337
+ * 🔖 publish v1.0.20 ([e721e95](https://github.com/guanghechen/algorithm.ts/commit/e721e959aef75eb10bd9bc434074c4d8f9885506))
338
+
339
+
340
+
341
+ ## 1.0.19 (2021-10-07)
342
+
343
+
344
+ ### Performance Improvements
345
+
346
+ * 🔖 publish v1.0.19 ([20db37d](https://github.com/guanghechen/algorithm.ts/commit/20db37dc1a3e533e15de0831fe02c20c6058f98b))
347
+
348
+
349
+
350
+ ## 1.0.18 (2021-09-21)
351
+
352
+
353
+ ### Performance Improvements
354
+
355
+ * 🔖 publish v1.0.18 ([f70493b](https://github.com/guanghechen/algorithm.ts/commit/f70493bc9d28de3bb0575be29d867743c19758e0))
356
+
357
+
358
+
359
+ ## 1.0.17 (2021-09-20)
360
+
361
+
362
+ ### Performance Improvements
363
+
364
+ * 🔖 publish v1.0.17 ([bee6123](https://github.com/guanghechen/algorithm.ts/commit/bee612385e4e6104f08e48d4d534413abcb18c33))
365
+
366
+
367
+
368
+ ## 1.0.16 (2021-09-11)
369
+
370
+
371
+ ### Performance Improvements
372
+
373
+ * 🔖 publish v1.0.16 ([73206d8](https://github.com/guanghechen/algorithm.ts/commit/73206d88d133e51d33a131d25e0ba7309409038a))
374
+
375
+
376
+
377
+ ## 1.0.15 (2021-09-11)
378
+
379
+
380
+ ### Performance Improvements
381
+
382
+ * 🔖 publish v1.0.15 ([e8fe1c7](https://github.com/guanghechen/algorithm.ts/commit/e8fe1c786a4e582b2965ea63b5c0f2700fe4f7b5))
383
+
384
+
385
+
386
+ ## 1.0.14 (2021-09-08)
387
+
388
+
389
+ ### Performance Improvements
390
+
391
+ * 🔖 publish v1.0.14 ([1b305da](https://github.com/guanghechen/algorithm.ts/commit/1b305da4856161dd5750073f8e0f0203b9c78d10))
392
+
393
+
394
+
395
+ ## 1.0.13 (2021-09-06)
396
+
397
+
398
+ ### Features
399
+
400
+ * ✨ implemented '[@algorithm](https://github.com/algorithm).ts/gcd' ([2b3c113](https://github.com/guanghechen/algorithm.ts/commit/2b3c113240a019677956b63d1137099a55a08531))
401
+
402
+
403
+ ### Performance Improvements
404
+
405
+ * 🔖 publish v1.0.13 ([26265a9](https://github.com/guanghechen/algorithm.ts/commit/26265a9124e1e1709b4688a21acf7eb468de7d35))
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/release-3.x.x/packages/gcd#readme">@algorithm.ts/gcd</a>
3
+ <a href="https://github.com/guanghechen/algorithm.ts/tree/@algorithm.ts/gcd@3.1.0/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">
@@ -101,5 +101,5 @@ A typescript implementation of the **gcd** and **Extended Euclidean** algorithm.
101
101
  * [数论基础之模方程初步][gcd]
102
102
 
103
103
 
104
- [homepage]: https://github.com/guanghechen/algorithm.ts/tree/release-3.x.x/packages/gcd#readme
104
+ [homepage]: https://github.com/guanghechen/algorithm.ts/tree/@algorithm.ts/gcd@3.1.0/packages/gcd#readme
105
105
  [gcd]: https://me.guanghechen.com/post/math/number-theory/%E6%A8%A1%E6%96%B9%E7%A8%8B/basic/
package/lib/cjs/index.cjs CHANGED
@@ -73,4 +73,3 @@ exports.euclidean = euclidean;
73
73
  exports.euclideanBigint = euclideanBigint;
74
74
  exports.gcd = gcd;
75
75
  exports.gcdBigint = gcdBigint;
76
- //# sourceMappingURL=index.cjs.map
package/lib/esm/index.mjs CHANGED
@@ -68,4 +68,3 @@ function gcdBigint(x, y) {
68
68
  }
69
69
 
70
70
  export { euclidean, euclideanBigint, gcd, gcdBigint };
71
- //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algorithm.ts/gcd",
3
- "version": "3.0.0-alpha.8",
3
+ "version": "3.1.0",
4
4
  "description": "GCD + Euclidean algorithm",
5
5
  "author": {
6
6
  "name": "guanghechen",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "files": [
35
35
  "lib/",
36
- "src/",
36
+ "!lib/**/*.map",
37
37
  "package.json",
38
38
  "CHANGELOG.md",
39
39
  "LICENSE",
@@ -45,12 +45,13 @@
45
45
  "test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
46
46
  },
47
47
  "dependencies": {
48
- "@algorithm.ts/constant": "^3.0.0-alpha.8"
48
+ "@algorithm.ts/constant": "^3.0.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "cross-env": "^7.0.3",
52
- "rimraf": "^4.4.0",
53
- "rollup": "^3.19.1"
52
+ "jest": "^29.5.0",
53
+ "rimraf": "^5.0.0",
54
+ "rollup": "^3.21.6"
54
55
  },
55
- "gitHead": "104385f40c0be99b843e3342e85b618761047b69"
56
+ "gitHead": "c2d4f73cd5143f56c334bf9736df5d61b0e5dec9"
56
57
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../constant/lib/esm/index.mjs","../../src/euclidean.ts","../../src/gcd.ts"],"sourcesContent":["const BIGINT_ZERO = BigInt(0);\nconst BIGINT_ONE = BigInt(1);\nconst CODEPOINT_DIGIT_0 = '0'.codePointAt(0);\nconst CODEPOINT_DIGIT_9 = '9'.codePointAt(0);\nconst CODEPOINT_UPPER_A = 'A'.codePointAt(0);\nconst CODEPOINT_UPPER_Z = 'Z'.codePointAt(0);\nconst CODEPOINT_LOWER_A = 'a'.codePointAt(0);\nconst CODEPOINT_LOWER_Z = 'z'.codePointAt(0);\n\nexport { BIGINT_ONE, BIGINT_Z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AAA;AACV,KAAA;AACD,IAAA,OAAO,CAAC,CAAA;AACV;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../constant/lib/esm/index.mjs","../../src/euclidean.ts","../../src/gcd.ts"],"sourcesContent":["const BIGINT_ZERO = BigInt(0);\nconst BIGINT_ONE = BigInt(1);\nconst CODEPOINT_DIGIT_0 = '0'.codePointAt(0);\nconst CODEPOINT_DIGIT_9 = '9'.codePointAt(0);\nconst CODEPOINT_UPPER_A = 'A'.codePointAt(0);\nconst CODEPOINT_UPPER_Z = 'Z'.codePointAt(0);\nconst CODEPOINT_LOWER_A = 'a'.codePointAt(0);\nconst CODEPOINT_LOWER_Z = 'z'.codePointAt(0);\n\nexport { BIGINT_ONE, BIGINT_ZERO, CODEPOINT_DIGIT_0, CODEPOINT_DIGIT_9, CODEPOINT_LOWER_A, CODEPOINT_LOWER_Z, CODEPOINT_UPPER_A, CODEPOINT_UPPER_Z };\n//# sourceMappingURL=index.mjs.map\n",null,null],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;;ACUZ,SAAA,SAAS,CAAC,CAAS,EAAE,CAAS,EAAA;AAC5C,IAAA,IAAI,CAAS,CAAA;AACb,IAAA,IAAI,CAAS,CAAA;AACb,IAAA,IAAI,CAAS,CAAA;AACb,IAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACX,IAAA,OAAO,CAAC,CAAE,EAAE,CAAE,EAAE,CAAE,CAAC,CAAA;AAEnB,IAAA,SAAS,KAAK,CAAC,EAAU,EAAE,EAAU,EAAA;QACnC,IAAI,EAAE,KAAK,CAAC,EAAE;YACZ,CAAC,GAAG,CAAC,CAAA;YACL,CAAC,GAAG,CAAC,CAAA;YACL,CAAC,GAAG,EAAE,CAAA;AACP,SAAA;AAAM,aAAA;AACL,YAAA,MAAM,CAAC,GA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,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAI;QACzB,MAAM,CAAC,GAAG,CAAC,CAAA;QACX,CAAC,GAAG,CAAC,CAAA;AACL,QAAA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACV,KAAA;AACD,IAAA,OAAO,CAAC,CAAA;AACV,CAAC;AASe,SAAA,SAAS,CAAC,CAAS,EAAE,CAAS,EAAA;IAC5C,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,WAAW,GAAI;QACnC,MAAM,CAAC,GAAG,CAAC,CAAA;QACX,CAAC,GAAG,CAAC,CAAA;AACL,QAAA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACV,KAAA;AACD,IAAA,OAAO,CAAC,CAAA;AACV;;;;"}
package/src/euclidean.ts DELETED
@@ -1,70 +0,0 @@
1
- import { BIGINT_ONE, BIGINT_ZERO } from '@algorithm.ts/constant'
2
-
3
- /**
4
- * Extended Euclidean algorithm for solving the smallest
5
- * integer solution (|x| + |y| smallest) of the equation `Ax + By = gcd(x,y)`.
6
- *
7
- * @param a
8
- * @param b
9
- * @returns
10
- * @see https://me.guanghechen.com/post/math/number-theory/%E6%A8%A1%E6%96%B9%E7%A8%8B/basic/
11
- */
12
- export function euclidean(a: number, b: number): [number, number, number] {
13
- let x: number
14
- let y: number
15
- let d: number
16
- solve(a, b)
17
- return [x!, y!, d!]
18
-
19
- function solve(_a: number, _b: number): void {
20
- if (_b === 0) {
21
- x = 1
22
- y = 0
23
- d = _a
24
- } else {
25
- const A = _a % _b
26
- const B = _b
27
- solve(B, A)
28
-
29
- const X = y
30
- const Y = x
31
-
32
- x = X
33
- y = Y - Math.floor(_a / _b) * X
34
- }
35
- }
36
- }
37
-
38
- /**
39
- * Bigint version.
40
- *
41
- * @param a
42
- * @param b
43
- * @returns
44
- * @see https://me.guanghechen.com/post/math/number-theory/%E6%A8%A1%E6%96%B9%E7%A8%8B/basic/
45
- */
46
- export function euclideanBigint(a: bigint, b: bigint): [bigint, bigint, bigint] {
47
- let x: bigint
48
- let y: bigint
49
- let d: bigint
50
- solve(a, b)
51
- return [x!, y!, d!]
52
-
53
- function solve(_a: bigint, _b: bigint): void {
54
- if (_b === BIGINT_ZERO) {
55
- x = BIGINT_ONE
56
- y = BIGINT_ZERO
57
- d = _a
58
- } else {
59
- const A = _a % _b
60
- const B = _b
61
- solve(B, A)
62
-
63
- const X = y
64
- const Y = x
65
-
66
- x = X
67
- y = Y - (_a / _b) * X
68
- }
69
- }
70
- }
package/src/gcd.ts DELETED
@@ -1,35 +0,0 @@
1
- import { BIGINT_ZERO } from '@algorithm.ts/constant'
2
-
3
- /**
4
- * Find the greatest common divisor of x and y
5
- *
6
- * @param x
7
- * @param y
8
- * @returns
9
- */
10
- export function gcd(x: number, y: number): number {
11
- let i = x
12
- for (let j = y; j !== 0; ) {
13
- const t = i
14
- i = j
15
- j = t % i
16
- }
17
- return i
18
- }
19
-
20
- /**
21
- * Bigint version.
22
- *
23
- * @param x
24
- * @param y
25
- * @returns
26
- */
27
- export function gcdBigint(x: bigint, y: bigint): bigint {
28
- let i = x
29
- for (let j = y; j !== BIGINT_ZERO; ) {
30
- const t = i
31
- i = j
32
- j = t % i
33
- }
34
- return i
35
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './euclidean'
2
- export * from './gcd'