Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Matrices/greatest_common_divisors.ads, Revision 1.1.1.1
1.1 maekawa 1: with Abstract_Ring;
2: with Abstract_Ring.Domain;
3:
4: generic
5:
6: with package Ring is new Abstract_Ring(<>);
7: with package Euclidean_Domain is new Ring.Domain(<>);
8:
9: package Greatest_Common_Divisors is
10:
11: -- DESCRIPTION :
12: -- This package contains routines for the computation
13: -- of the greatest common divisor and least common multiple.
14:
15: use Ring;
16: use Euclidean_Domain;
17:
18: function gcd ( a,b : number ) return number;
19:
20: -- DESCRIPTION :
21: -- Returns the greatest common divisor of a and b.
22:
23: function lcm ( a,b : number ) return number;
24:
25: -- DESCRIPTION :
26: -- Returns the least common multiple of a and b.
27:
28: procedure gcd ( a,b : in number; k,l,d : out number );
29:
30: -- DESCRIPTION :
31: -- Computes the greatest common divisor d of a and b;
32: -- After gcd(a,b,k,l,d), there holds: k*a + l*b = d.
33:
34: end Greatest_Common_Divisors;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>