From b8d9549bdd7d8492108d655a17513a03600a80b0 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 19 Sep 2006 23:05:28 +0000 Subject: Rework logic a bit for clean-up --- numpy/core/src/arraymethods.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'numpy/core/src/arraymethods.c') 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; } } -- cgit v1.2.1