bug-sather
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extended_gcd for INTI


From: K.Kodama
Subject: Re: extended_gcd for INTI
Date: Tue, 30 Jan 2001 14:44:46 +0900

Sorry! I failed again.

From: K.Kodama <address@hidden>
Subject: Re: extended_gcd for INTI
Date: Tue, 30 Jan 2001 11:19:02 +0900
Message-ID: <address@hidden>

>       extended_gcd(i,j:INTI, out f1: INTI, out f2:INTI):INTI is
....
>               loop

        extended_gcd(i,j:INTI, out f1: INTI, out f2:INTI):INTI is
                -- gcd = i*f1 + j*f2
                -- x:SAME:=one; y:SAME:=zero; u:SAME:=zero; v:SAME:=one;
                a,b,q:INTI;
                x:INTI:=#(1); y:INTI:=#(0); u:INTI:=#(0); v:INTI:=#(1);
                if i.is_neg then x:=-x; a:=-i; else a:=i; end;
                if j.is_neg then y:=-y; b:=-j; else b:=j; end;
                loop

-- 
K.Kodama(address@hidden)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]