[Top][All Lists]
[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 11:19:02 +0900 |
It was incomplete. Please change as follows.
From: K.Kodama <address@hidden>
Subject: extended_gcd for INTI
Date: Mon, 29 Jan 2001 08:12:20 +0900
Message-ID: <address@hidden>
> "extended_gcd" in INTI have a problem.
....
> extended_gcd(o:SAME,out f1: SAME, out f2:SAME):SAME is
> -- gcd = self*f1 + o*f2
> a:SAME:=self.abs; b:SAME:=o.abs; q:SAME;
> x:SAME:=#(1); y:SAME:=#(0); u:SAME:=#(0); v:SAME:=#(1);
> 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;
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; a::=-j; else a::=j; end;
q:INTI;
loop
--
K.Kodama(address@hidden)