error(self.pos, "can only complexify c numeric types")
type = PyrexTypes.CComplexType(type)
type.create_declaration_utility_code(env)
+ elif type is Builtin.complex_type:
+ # Special case: optimise builtin complex type into C's
+ # double complex. The parser cannot do this (as for the
+ # normal scalar types) as the user may have redeclared the
+ # 'complex' type. Testing for the exact type here works.
+ type = PyrexTypes.c_double_complex_type
+ type.create_declaration_utility_code(env)
+ self.complex = True
if type:
return type
else:
(1, 0, "double"): c_double_type,
(1, 1, "double"): c_longdouble_type,
- (1, 0, "complex"): c_float_complex_type,
+ (1, 0, "complex"): c_double_complex_type, # C: float, Python: double => Python wins
(1, 0, "floatcomplex"): c_float_complex_type,
(1, 0, "doublecomplex"): c_double_complex_type,
(1, 1, "doublecomplex"): c_longdouble_complex_type,