| 2670 | |
| 2671 | |
| 2672 | static PyObject * |
| 2673 | array_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 |
nothing calls this directly
no test coverage detected