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

Function safe_abs32

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

Source from the content-addressed store, hash-verified

58}
59
60static inline npy_int32
61safe_abs32(npy_int32 x) {
62 npy_int32 nx;
63 if (x>=0) {
64 return x;
65 }
66 nx = -x;
67 if (nx<0) {
68 set_overflow();
69 }
70 return nx;
71}
72
73static inline npy_int64
74safe_abs64(npy_int64 x) {

Callers 1

rational_absFunction · 0.85

Calls 1

set_overflowFunction · 0.85

Tested by

no test coverage detected