Greatest common divisor: Difference between revisions

Content added Content deleted
Line 478: Line 478:
a := abs( m );
a := abs( m );
b := abs( n );
b := abs( n );
if a = 0 then begin
while b not = 0 do begin
b
newA := b;
end
b := a rem b;
else begin
a := newA;
while b not = 0 do begin
end;
newA := b;
a
b := a rem b;
a := newA;
end;
a
end
end gcd ;
end gcd ;


write( gcd( -21, 35 ) );
write( gcd( -21, 35 ) );
end.
end.</syntaxhighlight>
</syntaxhighlight>


=={{header|Alore}}==
=={{header|Alore}}==