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

Function array_round

numpy/core/src/multiarray/methods.c:2672–2694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2670
2671
2672static PyObject *
2673array_round(PyArrayObject *self, PyObject *args, PyObject *kwds)
2674{
2675 int decimals = 0;
2676 PyArrayObject *out = NULL;
2677 static char *kwlist[] = {"decimals", "out", NULL};
2678
2679 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO&:round", kwlist,
2680 &decimals,
2681 PyArray_OutputConverter, &out)) {
2682 return NULL;
2683 }
2684
2685 PyObject *ret = PyArray_Round(self, decimals, out);
2686
2687 /* this matches the unpacking behavior of ufuncs */
2688 if (out == NULL) {
2689 return PyArray_Return((PyArrayObject *)ret);
2690 }
2691 else {
2692 return ret;
2693 }
2694}
2695
2696
2697

Callers

nothing calls this directly

Calls 2

PyArray_RoundFunction · 0.85
PyArray_ReturnFunction · 0.85

Tested by

no test coverage detected