MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / gcd

Function gcd

maths/greater_common_divisor.py:2–3  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

1# Greater Common Divisor - https://en.wikipedia.org/wiki/Greatest_common_divisor
2def gcd(a, b):
3 return b if a == 0 else gcd(b % a, a)
4
5def main():
6 try:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected