Greatest common divisor: Difference between revisions

m
→‎{{header|PowerShell}}: some whitespace to make reading easier
(added go)
m (→‎{{header|PowerShell}}: some whitespace to make reading easier)
Line 1,054:
=={{header|PowerShell}}==
===Recursive Euclid Algorithm===
<lang powershell>function getGet-gcdGCD ($x, $y)
{
if ($x -eq $y) { return $y }
if ($x -gt $y) {
$a = $x
$b = $y
}
else {
$a = $y
$b = $x
}
while (($a % $b) -ne0ne 0) {
$tmp = $a % $b
$a = $b
$b = $tmp
}
return $b
Anonymous user