summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-09-19 23:05:28 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-09-19 23:05:28 +0000
commitb8d9549bdd7d8492108d655a17513a03600a80b0 (patch)
treefa3d1666eb5948547dcf3f7a641a0ca936c38089 /numpy/core/src/arraymethods.c
parent2a99ea81a0a42500d27a76419ee8d12f08f54fd6 (diff)
downloadnumpy-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.c16
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;
}
}