עבור <math>m,n</math> שלמים, המספר השלם הגדול ביותר המחלק גם את <math>m</math> וגם את <math>n</math> ייקרא המחלק המשותף הגדול ביותר ויסומן <math>gcd(m,n)</math>.
<div align="left">
;m=12<BR>
;n=30<BR>
if n<m<BR>
;t=m<BR>
;m=n<BR>
;n=t<BR>
end<BR>
for i=1:m<BR>
if mod(m,i)==0 && mod(n,i)=0<BR>
;gcd=i<BR>
end<BR>
end<BR>
;(disp(gcd
<div align="right">
====קבלת מינימום====