Fix comparison bug for longs and doubles #208053
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 29 Mar 2008 20:03:23 +0000 (13:03 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 29 Mar 2008 20:03:23 +0000 (13:03 -0700)
Cython/Compiler/ExprNodes.py

index b75178a8c98c2bfba6c783bd1d93820c01c5f0d5..63be9d6168862ff7768f0301c94e168b5cf53ca6 100644 (file)
@@ -3338,6 +3338,8 @@ class CmpNode:
             if (type1.is_extension_type or type2.is_extension_type) \
                     and not type1.same_as(type2):
                 common_type = py_object_type
+            elif type1.is_numeric:
+                common_type = PyrexTypes.widest_numeric_type(type1, type2)
             else:
                 common_type = type1
             code1 = operand1.result_as(common_type)