Commit 4a07d490 authored by Taddeus Kroes's avatar Taddeus Kroes

gcd() now takes an arbitrary number of arguments

parent e8143dfb
def gcd(a, b):
def _gcd(a, b):
while b:
a, b = b, a % b
return a
def gcd(*args):
return reduce(_gcd, args)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment