MCPcopy Create free account
hub / github.com/numpy/numpy / _gcd

Function _gcd

numpy/core/_internal.py:844–848  ·  view source on GitHub ↗

Calculate the greatest common divisor of a and b

(a, b)

Source from the content-addressed store, hash-verified

842 return p
843
844def _gcd(a, b):
845 """Calculate the greatest common divisor of a and b"""
846 while b:
847 a, b = b, a % b
848 return a
849
850def _lcm(a, b):
851 return a // _gcd(a, b) * b

Callers 1

_lcmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected