[Numpy-svn] r3192 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Sep 19 18:05:38 CDT 2006


Author: oliphant
Date: 2006-09-19 18:05:28 -0500 (Tue, 19 Sep 2006)
New Revision: 3192

Modified:
   trunk/numpy/core/src/arraymethods.c
Log:
Rework logic a bit for clean-up

Modified: trunk/numpy/core/src/arraymethods.c
===================================================================
--- trunk/numpy/core/src/arraymethods.c	2006-09-19 23:03:14 UTC (rev 3191)
+++ trunk/numpy/core/src/arraymethods.c	2006-09-19 23:05:28 UTC (rev 3192)
@@ -1360,17 +1360,15 @@
 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;
         }
 }
 



More information about the Numpy-svn mailing list