RosettaCodeData/Task/Greatest-common-divisor/PowerShell/greatest-common-divisor-3.psh
2015-11-18 06:14:39 +00:00

6 lines
111 B
Text

Function Get-GCD( $x, $y ) {
while ($y -ne 0) {
$x, $y = $y, ($x % $y)
}
[Math]::abs($x)
}