Expand description
Contains multiple variants of the Extended Euclidean Algorithm.
Functions§
- eea
- For
a, bcomputess, t, dsuch thats*a + t*b == dis a greatest common divisor ofaandb. - gcd
- Finds a greatest common divisor of a and b.
- half_
eea unstable-enable - Computes the gcd
dofaandb, together with “half a Bezout identity”, i.e. somessuch thats * a = d mod b. - inv_crt
- Computes x such that
x = a mod pandx = b mod q. Requires that p and q are coprime. - lcm
- Finds the least common multiple of two elements
a, bin a euclidean ring, i.e. the smallest (w.r.t. divisibility) elementywitha, b | y. - signed_
eea - For integers a, b finds the smallest integers s, t so that
s*a + t*b == gcd(a, b)is the greatest common divisor of a, b. - signed_
gcd - Finds the greatest common divisor of a and b.
- signed_
lcm - Finds the least common multiple of two elements in an ordered euclidean ring, e.g. of two integers.