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

Function PyUFunc_GiveFloatingpointErrors

numpy/core/src/umath/extobj.c:276–293  ·  view source on GitHub ↗

* Handler which uses the default `np.errstate` given that `fpe_errors` is * already set. `fpe_errors` is typically the (nonzero) result of * `npy_get_floatstatus_barrier`. * * Returns -1 on failure (an error was raised) and 0 on success. */

Source from the content-addressed store, hash-verified

274 * Returns -1 on failure (an error was raised) and 0 on success.
275 */
276NPY_NO_EXPORT int
277PyUFunc_GiveFloatingpointErrors(const char *name, int fpe_errors)
278{
279 int bufsize, errmask;
280 PyObject *errobj;
281
282 if (PyUFunc_GetPyValues((char *)name, &bufsize, &errmask,
283 &errobj) < 0) {
284 return -1;
285 }
286 int first = 1;
287 if (PyUFunc_handlefperr(errmask, errobj, fpe_errors, &first)) {
288 Py_XDECREF(errobj);
289 return -1;
290 }
291 Py_XDECREF(errobj);
292 return 0;
293}
294
295
296/*

Callers 9

PyArray_CopyAsFlatFunction · 0.85
raw_array_assign_scalarFunction · 0.85
cast_raw_scalar_itemFunction · 0.85
raw_array_assign_arrayFunction · 0.85
array_assign_subscriptFunction · 0.85
PyArray_CastRawArraysFunction · 0.85

Calls 2

PyUFunc_GetPyValuesFunction · 0.85
PyUFunc_handlefperrFunction · 0.85

Tested by

no test coverage detected