[BACK]Return to greatest_common_divisors.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Matrices

File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Matrices / greatest_common_divisors.ads (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:23 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with Abstract_Ring;
with Abstract_Ring.Domain;

generic

  with package Ring is new Abstract_Ring(<>);
  with package Euclidean_Domain is new Ring.Domain(<>);

package Greatest_Common_Divisors is

-- DESCRIPTION :
--   This package contains routines for the computation
--   of the greatest common divisor and least common multiple.

  use Ring;
  use Euclidean_Domain;

  function gcd ( a,b : number ) return number;

  -- DESCRIPTION :
  --   Returns the greatest common divisor of a and b.

  function lcm ( a,b : number ) return number;

  -- DESCRIPTION :
  --   Returns the least common multiple of a and b.

  procedure gcd ( a,b : in number; k,l,d : out number );

  -- DESCRIPTION :
  --   Computes the greatest common divisor d of a and b;
  --   After gcd(a,b,k,l,d), there holds: k*a + l*b = d.

end Greatest_Common_Divisors;