Expand description
Contains multiple variants of the Extended Euclidean Algorithm.
Functions§
- eea
- For
a, b
computess, t, d
such thats*a + t*b == d
is a greatest common divisor ofa
andb
. - gcd
- Finds a greatest common divisor of a and b.
- half_
eea unstable-enable
- Computes the gcd
d
ofa
andb
, together with “half a Bezout identity”, i.e. somes
such thats * a = d mod b
. - inv_crt
- Computes x such that
x = a mod p
andx = b mod q
. Requires that p and q are coprime. - lcm
- Finds the least common multiple of two elements
a, b
in a euclidean ring, i.e. the smallest (w.r.t. divisibility) elementy
witha, 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.