Least common multiple/fr
From Free Pascal wiki
Jump to navigationJump to searchThe printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
│
English (en) │
suomi (fi) │
français (fr) │
русский (ru) │
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=3*12=4*9).
Fonction LeastCommonMultiple
function LeastCommonMultiple(a, b: Int64): Int64;
begin
result := b * (a div GreatestCommonDivisor(a, b))
end;
Remarque: la fonction Function GreatestCommonDivisor doit être définie avant cette fonction.