Sign in Join
Wiki copytemporary

Revision 1 of 1, by Trev on 2-19-2020. The page as it is now.

Least common multiple/fr

Le plus petit multiple commun (PPMC) de deux entiers a et b et est le plus entier positif divisible par a et b.

Par exemple : pour 12 et 9, le PPMC vaut 36 (36=312=49).

Fonction LeastCommonMultiple

pascal
function LeastCommonMultiple(a, b: Int64): Int64;
begin
  result := b * (a div GreatestCommonDivisor(a, b))
end;

Note: la fonction Function GreatestCommonDivisor doit être définie avant cette fonction.

Voir aussi


From the Free Pascal wiki, page "Least common multiple/fr", as it stood on 2020-02-19 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.