Go to the first, previous, next, last section, table of contents.


igcd,igcdcntl

igcd(i1,i2)
:: 整数の GCD (最大公約数)
igcdcntl([i])
:: 整数 GCDのアルゴリズム選択
return
整数
i1 i2 i
整数
[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)
参照
section gcd, gcdz.


Go to the first, previous, next, last section, table of contents.