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

Function gcd

project_euler/problem_05/sol2.py:9–10  ·  view source on GitHub ↗
(x,y)

Source from the content-addressed store, hash-verified

7
8""" Euclidean GCD Algorithm """
9def gcd(x,y):
10 return x if y==0 else gcd(y,x%y)
11
12""" Using the property lcm*gcd of two numbers = product of them """
13def lcm(x,y):

Callers 1

lcmFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected