Bézout's equation for Gaussian integers and
Z[Ö2]
The Euclidean algorithm for Gaussian integers,
properly done, starts with Gaussian integers a
and b and calculates Gaussian integers s and t such that
sa + tb divides both a and b. It follows
that sa + tb is a greatest common divisor of
a and b.
This program accepts Gaussian integers in the form 3 + 2i, or elements
of Z[Ö2] in the form 3 + 2r,
where r stands for Ö2
(but not simultaneously).