Skip to content

Instantly share code, notes, and snippets.

@mcichecki
Created June 23, 2018 10:50
Show Gist options
  • Save mcichecki/58fa68d0433d00f75a768bd9251c735b to your computer and use it in GitHub Desktop.
Save mcichecki/58fa68d0433d00f75a768bd9251c735b to your computer and use it in GitHub Desktop.
GCD, Swift implementation
private func gcd(_ p: Int, _ q: Int) -> Int {
if q == 0 {
return p
}
return gcd(q, p % q);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment