2021-03-24 13:04:30 +00:00
|
|
|
export interface Egcd {
|
|
|
|
g: bigint;
|
|
|
|
x: bigint;
|
|
|
|
y: bigint;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* An iterative implementation of the extended euclidean algorithm or extended greatest common divisor algorithm.
|
|
|
|
* Take positive integers a, b as input, and return a triple (g, x, y), such that ax + by = g = gcd(a, b).
|
|
|
|
*
|
|
|
|
* @param a
|
|
|
|
* @param b
|
|
|
|
*
|
2022-09-12 08:59:51 +00:00
|
|
|
* @throws {@link RangeError} if a or b are <= 0
|
2021-03-24 17:30:45 +00:00
|
|
|
*
|
2021-03-24 13:04:30 +00:00
|
|
|
* @returns A triple (g, x, y), such that ax + by = g = gcd(a, b).
|
|
|
|
*/
|
|
|
|
export declare function eGcd(a: number | bigint, b: number | bigint): Egcd;
|
|
|
|
//# sourceMappingURL=egcd.d.ts.map
|