diff options
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r-- | numpy/core/src/arraymethods.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 3bc599ff6..179e48ce9 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -1360,17 +1360,15 @@ array_transpose(PyArrayObject *self, PyObject *args) static int _get_type_num_double(PyArray_Descr *dtype1, PyArray_Descr *dtype2) { - if (dtype2 == NULL) { /* Use floating point reduction - on integer data-types */ - if (dtype1->type_num < NPY_FLOAT) { - return NPY_DOUBLE; - } - else { - return dtype1->type_num; - } + if (dtype2 != NULL) + return dtype2->type_num; + + /* For integer or bool data-types */ + if (dtype1->type_num < NPY_FLOAT) { + return NPY_DOUBLE; } else { - return dtype2->type_num; + return dtype1->type_num; } } |