Difference between revisions of "Least common multiple/fr"
From Lazarus wiki
Jump to navigationJump to search (Created page with "{{Least common multiple}} Le plus petit multiple commun (PPMC) de deux entiers a et b et est le plus entier positif qui est divisible par a et b. Par exemple : pour 12 et 9,...") |
m (Fixed syntax highlighting) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Least common multiple}} | {{Least common multiple}} | ||
− | Le plus petit multiple commun (PPMC) de deux entiers a et b et est le plus entier positif | + | 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). | Par exemple : pour 12 et 9, le PPMC vaut 36 (36=3*12=4*9). | ||
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 14: | Line 14: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | {{Note| la fonction Function [[Greatest common divisor/fr#Fonction GreatestCommonDivisor |GreatestCommonDivisor ]] doit être définie avant cette fonction}} | + | {{Note| la fonction Function [[Greatest common divisor/fr#Fonction GreatestCommonDivisor |GreatestCommonDivisor ]] doit être définie avant cette fonction.}} |
== 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.