

xgcd()            Multiple-Precision Mathematics           xgcd()




Extended greatest-common-divisor function

#include <mprec.h>
vvooiidd xxggccdd(_a, _b, _r, _s, _g)
mmiinntt *_a, *_b, *_r, *_s, *gg;

The COHERENT  system includes a suite of  routines that allow you
to perform multiple-precision  mathematics.  The function xgcd is
an extended version of the greatest-common-division function.  It
sets the multiple-precision integer  (or mmiinntt) pointed to by g to
the greatest common divisor of the  mmiinntt pointed to by a and that
pointed to by b.  It also sets the mmiinntts pointed to by r and s so
the following relation holds:


             _g = _a * _r + _b * _s


r, s, and g must all be distinct.

***** See Also *****

multiple-precision mathematics

































COHERENT Lexicon                                           Page 1


