bigint-mod-arith/types/egcd.d.ts

19 lines
589 B
TypeScript
Raw Normal View History

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
*
* @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