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

Function _uint64_euclidean_gcd

numpy/core/src/multiarray/datetime.c:1069–1086  ·  view source on GitHub ↗

Euclidean algorithm on two positive numbers */

Source from the content-addressed store, hash-verified

1067
1068/* Euclidean algorithm on two positive numbers */
1069static npy_uint64
1070_uint64_euclidean_gcd(npy_uint64 x, npy_uint64 y)
1071{
1072 npy_uint64 tmp;
1073
1074 if (x > y) {
1075 tmp = x;
1076 x = y;
1077 y = tmp;
1078 }
1079 while (x != y && y != 0) {
1080 tmp = x % y;
1081 x = y;
1082 y = tmp;
1083 }
1084
1085 return x;
1086}
1087
1088/*
1089 * Computes the conversion factor to convert data with 'src_meta' metadata

Calls

no outgoing calls

Tested by

no test coverage detected