diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-19 23:05:28 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-19 23:05:28 +0000 |
commit | b8d9549bdd7d8492108d655a17513a03600a80b0 (patch) | |
tree | fa3d1666eb5948547dcf3f7a641a0ca936c38089 /numpy/core/src/arraymethods.c | |
parent | 2a99ea81a0a42500d27a76419ee8d12f08f54fd6 (diff) | |
download | numpy-b8d9549bdd7d8492108d655a17513a03600a80b0.tar.gz |
Rework logic a bit for clean-up
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; } } |