Revision history [back]

Euclidean Algorithm

hi, I wright these commands in sage to have Euclidean Algorithm but i just get error.. what is the problem of these algorithm? am I wright it in a wrong way? by the way how can I create a file named euclid.sage and save below command in it?

Begin euclid.sage

r=a%b print (a,b,r) while r != 0: a=b; b=r r=a%b print (a,b,r)

End euclid.sage

 2 improved style vdelecroix 5744 ●14 ●66 ●116 http://www.labri.fr/pe...

Euclidean Algorithmalgorithm

hi, Hi,

I wright wrote these commands in sage to have Euclidean Algorithm algorithm but i just I only get an error.. what is the problem of these algorithm? am I wright it in a wrong way? this algorithm?

r=a%b
print (a,b,r)
while r != 0:
a=b; b=r
r=a%b
print (a,b,r)


by the way how can I create a file named euclid.sage and save below the above command in it?

Begin euclid.sage

r=a%b print (a,b,r) while r != 0: a=b; b=r r=a%b print (a,b,r)