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

Function gcd

numpy/core/src/umath/_rational_tests.c:86–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static inline npy_int64
87gcd(npy_int64 x, npy_int64 y) {
88 x = safe_abs64(x);
89 y = safe_abs64(y);
90 if (x < y) {
91 npy_int64 t = x;
92 x = y;
93 y = t;
94 }
95 while (y) {
96 npy_int64 t;
97 x = x%y;
98 t = x;
99 x = y;
100 y = t;
101 }
102 return x;
103}
104
105static inline npy_int64
106lcm(npy_int64 x, npy_int64 y) {

Callers 5

normalizeFunction · 0.90
lcmFunction · 0.85
make_rational_slowFunction · 0.85
make_rational_fastFunction · 0.85
pyrational_richcompareFunction · 0.85

Calls 1

safe_abs64Function · 0.85

Tested by

no test coverage detected