summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-04-11 22:40:37 -0700
committerTyler Reddy <tyler.je.reddy@gmail.com>2019-05-14 13:52:36 -0700
commited825fb2823c60de45950cab286ccc5cf9a2cdcb (patch)
tree33f6194d2a91b2312549e9de295e0c2847946a7b /numpy/core/src
parent6492f632a92439c82c74efa6753e10ce9360c6ba (diff)
downloadnumpy-ed825fb2823c60de45950cab286ccc5cf9a2cdcb.tar.gz
BUG: Restore the old non-object behavior for min > max
This changes the object array behavior to match the other behavior
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;
}