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

Function safe_abs64

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

Source from the content-addressed store, hash-verified

71}
72
73static inline npy_int64
74safe_abs64(npy_int64 x) {
75 npy_int64 nx;
76 if (x>=0) {
77 return x;
78 }
79 nx = -x;
80 if (nx<0) {
81 set_overflow();
82 }
83 return nx;
84}
85
86static inline npy_int64
87gcd(npy_int64 x, npy_int64 y) {

Callers 2

gcdFunction · 0.85
lcmFunction · 0.85

Calls 1

set_overflowFunction · 0.85

Tested by

no test coverage detected