home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
compiler
/
ubasic
/
malm
/
fcgcd.ub
< prev
next >
Wrap
Text File
|
1990-08-22
|
391b
|
13 lines
10 *Fcgcd(A,B,&C,&Ca)
20 ' Gcd with one coefficient. c is the gcd of a and b.
30 ' ca*a + cb*b = c for some cb 16 April 1990
40 local R,Q,T,Af,Bf,B1
50 Ca=1:B1=0:Af=A:Bf=B
60 while B
70 T=B:Q=A\B:B=res
80 R=Ca-Q*B1:Ca=B1:B1=R:A=T
100 wend
110 C=A
160 if C<0 then neg C:neg Ca endif
170 return:' End of procedure Fcgcd.