https://wiki.freepascal.org/index.php?title=Greatest_common_divisor/fr&feed=atom&action=history
Greatest common divisor/fr - Revision history
2024-03-29T06:35:34Z
Revision history for this page on the wiki
MediaWiki 1.35.6
https://wiki.freepascal.org/index.php?title=Greatest_common_divisor/fr&diff=132260&oldid=prev
Trev: Fixed syntax highlighting
2020-02-16T11:13:13Z
<p>Fixed syntax highlighting</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:13, 16 February 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l8" >Line 8:</td>
<td colspan="2" class="diff-lineno">Line 8:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Fonction GreatestCommonDivisor ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Fonction GreatestCommonDivisor ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight <ins class="diffchange diffchange-inline">lang=pascal</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function GreatestCommonDivisor(a, b: Int64): Int64;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function GreatestCommonDivisor(a, b: Int64): Int64;</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l46" >Line 46:</td>
<td colspan="2" class="diff-lineno">Line 46:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Least common multiple/fr|plus petit multiple commun]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Least common multiple/fr|plus petit multiple commun]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Mod/fr|Mod]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Mod/fr|Mod]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><br></del></div></td><td colspan="2"> </td></tr>
</table>
Trev
https://wiki.freepascal.org/index.php?title=Greatest_common_divisor/fr&diff=105479&oldid=prev
E-ric: Created page with "{{Greatest common divisor}} Le plus grand diviseur commun (PGDC) de deux entiers est le plus grand entier qui les divise les deux. Si les nombres sont 121 et 143 alors le PGD..."
2016-11-24T06:40:55Z
<p>Created page with "{{Greatest common divisor}} Le plus grand diviseur commun (PGDC) de deux entiers est le plus grand entier qui les divise les deux. Si les nombres sont 121 et 143 alors le PGD..."</p>
<p><b>New page</b></p><div>{{Greatest common divisor}}<br />
<br />
Le plus grand diviseur commun (PGDC) de deux entiers est le plus grand entier qui les divise les deux.<br />
Si les nombres sont 121 et 143 alors le PGDC est 11 (121=11x11 et 143=11*13)<br />
<br />
Il existe plusieurs méthodes pour le calculer. P.ex., l'algorithme d'Euclide basé sur la division peut être implémenté.<br />
<br />
== Fonction GreatestCommonDivisor ==<br />
<br />
<syntaxhighlight><br />
<br />
function GreatestCommonDivisor(a, b: Int64): Int64;<br />
var<br />
temp: Int64;<br />
begin<br />
while b <> 0 do<br />
begin<br />
temp := b;<br />
b := a mod b;<br />
a := temp<br />
end;<br />
result := a<br />
end; <br />
<br />
function GreatestCommonDivisor_EuclidsSubtractionMethod(a, b: Int64): Int64;<br />
//only works with positive integers<br />
begin<br />
if (a < 0) then a := -a;<br />
if (b < 0) then b := -b;<br />
if (a = 0) then Exit(b);<br />
if (b = 0) then Exit(a); <br />
while not (a = b) do<br />
begin<br />
if (a > b) then<br />
a := a - b<br />
else<br />
b := b - a;<br />
end;<br />
Result := a;<br />
end;<br />
</syntaxhighlight><br />
<br />
== Voir aussi ==<br />
<br />
* [http://rosettacode.org/wiki/Greatest_common_divisor#Pascal_.2F_Delphi_.2F_Free_Pascal Recursive example]<br />
* [[Least common multiple/fr|plus petit multiple commun]]<br />
* [[Mod/fr|Mod]]<br />
<br></div>
E-ric