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

Function safe_neg

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

Source from the content-addressed store, hash-verified

50/* Integer arithmetic utilities */
51
52static inline npy_int32
53safe_neg(npy_int32 x) {
54 if (x==(npy_int32)1<<31) {
55 set_overflow();
56 }
57 return -x;
58}
59
60static inline npy_int32
61safe_abs32(npy_int32 x) {

Callers 3

make_rational_slowFunction · 0.85
rational_negativeFunction · 0.85
rational_inverseFunction · 0.85

Calls 1

set_overflowFunction · 0.85

Tested by

no test coverage detected