diff options
Diffstat (limited to 'numpy/core/src/umathmodule.c.src')
-rw-r--r-- | numpy/core/src/umathmodule.c.src | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src index ee3dca549..fa7cd678b 100644 --- a/numpy/core/src/umathmodule.c.src +++ b/numpy/core/src/umathmodule.c.src @@ -1207,7 +1207,6 @@ static void /**end repeat**/ - static PyObject * Py_reciprocal(PyObject *o) { @@ -1219,6 +1218,40 @@ Py_reciprocal(PyObject *o) return result; } +static PyObject * +_npy_ObjectMax(PyObject *i1, PyObject *i2) +{ + int cmp; + PyObject *res; + if (PyObject_Cmp(i1, i2, &cmp) < 0) return NULL; + + if (cmp >= 0) { + res = i1; + } + else { + res = i2; + } + Py_INCREF(res); + return res; +} + +static PyObject * +_npy_ObjectMin(PyObject *i1, PyObject *i2) +{ + int cmp; + PyObject *res; + if (PyObject_Cmp(i1, i2, &cmp) < 0) return NULL; + + if (cmp <= 0) { + res = i1; + } + else { + res = i2; + } + Py_INCREF(res); + return res; +} + /* ones_like is defined here because it's used for x**0 */ /**begin repeat |