.TH xgcd() "" "" "Multiple-Precision Mathematics (libmp)"
.PC "Extended greatest-common-divisor function"
.B "#include <mprec.h>"
\fBvoid xgcd(\fIa, b, r, s, g\^\fB)\fR
\fBmint *\fIa, \fB*\fIb, \fB*\fIr, \fB*\fIs, \fB*\fBg\^\fB;\fR
.PP
.B xgcd()
is an extended version of the greatest-common-division function.
It sets the multiple-precision integer (or \fBmint\fR)
pointed to by
.I g
to the greatest common divisor of the \fBmint\fR pointed to by
.I a
and that pointed to by
.IR b .
It also sets the \fBmint\fRs pointed to by
.I r
and
.I s
so the following relation holds:
.DS
	\fIg\fR = \fIa\fR \(mu \fIr\fR + \fIb\fR \(mu \fIs\fR
.DE
.PP
.IR r ,
.IR s ,
and
.I g
must all be distinct.
.SH "See Also"
.Xr "libmp" libmp
