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

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Sep 11 19:38:42 CDT 2006


Author: oliphant
Date: 2006-09-11 19:38:39 -0500 (Mon, 11 Sep 2006)
New Revision: 3144

Modified:
   trunk/numpy/core/src/ufuncobject.c
Log:
Update type comparison to be based on equivalence classes and safe casting defining the ordering.

Modified: trunk/numpy/core/src/ufuncobject.c
===================================================================
--- trunk/numpy/core/src/ufuncobject.c	2006-09-11 23:31:20 UTC (rev 3143)
+++ trunk/numpy/core/src/ufuncobject.c	2006-09-12 00:38:39 UTC (rev 3144)
@@ -3125,11 +3125,10 @@
 cmp_arg_types(int *arg1, int *arg2, int n)
 {
         while (n--) {
-                if (*arg1 > *arg2)
-                        return 1;
-                else if (*arg1 < *arg2)
+                if (PyArray_EquivTypenums(*arg1, *arg2)) continue;
+                if (PyArray_CanCastSafely(*arg1, *arg2))
                         return -1;
-                arg1++; arg2++;
+                return 1;
         }
         return 0;
 }



More information about the Numpy-svn mailing list