Difference between revisions of "Least common multiple/fr"
From Lazarus wiki
Jump to navigationJump to searchm |
m (Fixed syntax highlighting) |
||
Line 7: | Line 7: | ||
==Fonction LeastCommonMultiple== | ==Fonction LeastCommonMultiple== | ||
− | <syntaxhighlight> | + | <syntaxhighlight lang=pascal> |
function LeastCommonMultiple(a, b: Int64): Int64; | function LeastCommonMultiple(a, b: Int64): Int64; | ||
begin | begin | ||
Line 18: | Line 18: | ||
== Voir aussi == | == Voir aussi == | ||
* [[Greatest common divisor/fr|Plus grand diviseur commun]] | * [[Greatest common divisor/fr|Plus grand diviseur commun]] | ||
− |
Latest revision as of 02:28, 19 February 2020
│
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.