summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/umath/clip.c.src2
-rw-r--r--numpy/core/src/umath/funcs.inc.src4
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/umath/clip.c.src b/numpy/core/src/umath/clip.c.src
index ad9a0864b..30fa3d2b3 100644
--- a/numpy/core/src/umath/clip.c.src
+++ b/numpy/core/src/umath/clip.c.src
@@ -76,7 +76,7 @@
*/
#define _NPY_CLIP(x, min, max) \
- _NPY_@name@_MAX(_NPY_@name@_MIN((x), (max)), (min))
+ _NPY_@name@_MIN(_NPY_@name@_MAX((x), (min)), (max))
NPY_NO_EXPORT void
@name@_clip(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
diff --git a/numpy/core/src/umath/funcs.inc.src b/numpy/core/src/umath/funcs.inc.src
index 555990ca8..c2732f925 100644
--- a/numpy/core/src/umath/funcs.inc.src
+++ b/numpy/core/src/umath/funcs.inc.src
@@ -262,11 +262,11 @@ npy_ObjectLCM(PyObject *i1, PyObject *i2)
static PyObject *
npy_ObjectClip(PyObject *arr, PyObject *min, PyObject *max) {
- PyObject *o = npy_ObjectMin(arr, max);
+ PyObject *o = npy_ObjectMax(arr, min);
if (o == NULL) {
return NULL;
}
- Py_SETREF(o, npy_ObjectMax(o, min));
+ Py_SETREF(o, npy_ObjectMin(o, max));
return o;
}