[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, Sun Oct 29 17:45:23 2000 UTC (23 years, 8 months ago) by maekawa
Branch point for: MAIN

Initial revision

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;