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
|
|
|
|
*
|
2021-03-24 17:30:45 +00:00
|
|
|
* @throws {RangeError}
|
|
|
|
* This excepction is thrown if a or b are less than 0
|
|
|
|
*
|
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
|