igcd
,igcdcntl
igcd()
returns the integer greatest common divisor of
the given two integers.
gcd()
, gcdz()
for polynomial GCD.
igcdcntl
.
0
1
2
3
2
, 3
are due to [Weber]
.
In most cases 3
is the fastest, but there are exceptions.
[0] A=lrandom(10^4)$ [1] B=lrandom(10^4)$ [2] C=lrandom(10^4)$ [3] D=A*C$ [4] E=A*B$ [5] cputime(1)$ [6] igcd(D,E)$ 0.6sec + gc : 1.93sec(2.531sec) [7] igcdcntl(1)$ [8] igcd(D,E)$ 0.27sec(0.2635sec) [9] igcdcntl(2)$ [10] igcd(D,E)$ 0.19sec(0.1928sec) [11] igcdcntl(3)$ [12] igcd(D,E)$ 0.08sec(0.08023sec)
gcd
, gcdz
.
Go to the first, previous, next, last section, table of contents.