Function Xgcd - Math.js
Calculate the extended greatest common divisor for two values. See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.
Syntax #
math.xgcd(a, b)Parameters #
| Parameter | Type | Description |
|---|---|---|
| a | number | BigNumber | An integer number |
| b | number | BigNumber | An integer number |
Returns #
| Type | Description |
|---|---|
| Array | Returns an array containing 3 integers [div, m, n] where div = gcd(a, b) and a*m + b*n = div |
Throws #
Type | Description —- | ———–
Examples #
math.xgcd(8, 12) // returns [4, -1, 1] math.gcd(8, 12) // returns 4 math.xgcd(36163, 21199) // returns [1247, -7, 12]See also #
gcd, lcm
mathjs.org • copyright © 2013-2026 jos de jong • background by waseem dahman
Từ khóa » Xgcd
-
Extended Euclidean Algorithm - Wikipedia
-
Extended Euclidean Algorithm (XGCD) - YouTube
-
[PDF] Lecture 13: Extended GCD Algorithm - Purdue Computer Science
-
[PDF] Extended Euclidean Algorithm
-
-
[PDF] Extended Euclidean Algorithm (XGCD) - Hyperelliptic Org
-
SI335: Number Theoretic Computations (exponentiation) - USNA
-
A Fast Large-Integer Extended GCD ... - Cryptology EPrint Archive
-
Function Xgcd - Mathlion - Read The Docs
-
Number Theory -- Sage
-
A Fast Large-Integer Extended GCD Algorithm And Hardware ...
-
at.xgcd - Mathlib Docs - Lean Community
-
Extended Euclidean (xgcd) In Quadratic Integer Rings