mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
16 lines
339 B
Python
16 lines
339 B
Python
class GCDFinder(object):
|
|
def __init__(self, a, b):
|
|
self.a = a
|
|
self.b = b
|
|
|
|
def calculate(self):
|
|
a = self.a
|
|
b = self.b
|
|
while a != 0 and b != 0:
|
|
if a > b:
|
|
a = a % b
|
|
else:
|
|
b = b % a
|
|
if a == 0:
|
|
return b
|
|
return a |