Created
June 23, 2018 10:50
-
-
Save mcichecki/58fa68d0433d00f75a768bd9251c735b to your computer and use it in GitHub Desktop.
GCD, Swift implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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