MCPcopy Index your code
hub / github.com/python/cpython / gcd

Function gcd

Lib/test/test_binop.py:7–11  ·  view source on GitHub ↗

Greatest common divisor using Euclid's algorithm.

(a, b)

Source from the content-addressed store, hash-verified

5from abc import ABCMeta
6
7def gcd(a, b):
8 """Greatest common divisor using Euclid's algorithm."""
9 while a:
10 a, b = b%a, a
11 return b
12
13def isint(x):
14 """Test whether an object is an instance of int."""

Callers 4

test_gcdMethod · 0.85
__init__Method · 0.85
test_gcdMethod · 0.85
testGcdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected