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

Function set_zero_divide

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

Source from the content-addressed store, hash-verified

33}
34
35static void
36set_zero_divide(void) {
37#ifdef ACQUIRE_GIL
38 /* Need to grab the GIL to dodge a bug in numpy */
39 PyGILState_STATE state = PyGILState_Ensure();
40#endif
41 if (!PyErr_Occurred()) {
42 PyErr_SetString(PyExc_ZeroDivisionError,
43 "zero divide in rational arithmetic");
44 }
45#ifdef ACQUIRE_GIL
46 PyGILState_Release(state);
47#endif
48}
49
50/* Integer arithmetic utilities */
51

Callers 2

make_rational_slowFunction · 0.85
rational_inverseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected