|
|
1.1 root 1:
2:
3: xgcd() Multiple-Precision Mathematics xgcd()
4:
5:
6:
7:
8: Extended greatest-common-divisor function
9:
10: #include <mprec.h>
11: vvooiidd xxggccdd(_a, _b, _r, _s, _g)
12: mmiinntt *_a, *_b, *_r, *_s, *gg;
13:
14: The COHERENT system includes a suite of routines that allow you
15: to perform multiple-precision mathematics. The function xgcd is
16: an extended version of the greatest-common-division function. It
17: sets the multiple-precision integer (or mmiinntt) pointed to by g to
18: the greatest common divisor of the mmiinntt pointed to by a and that
19: pointed to by b. It also sets the mmiinntts pointed to by r and s so
20: the following relation holds:
21:
22:
23: _g = _a * _r + _b * _s
24:
25:
26: r, s, and g must all be distinct.
27:
28: ***** See Also *****
29:
30: multiple-precision mathematics
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.