return
if self.type.is_complex:
self.infix = False
- self.operand1 = self.operand1.coerce_to(self.type, env)
- self.operand2 = self.operand2.coerce_to(self.type, env)
+ if not self.infix or (type1.is_numeric and type2.is_numeric):
+ self.operand1 = self.operand1.coerce_to(self.type, env)
+ self.operand2 = self.operand2.coerce_to(self.type, env)
def compute_c_result_type(self, type1, type2):
if self.c_types_okay(type1, type2):
import ExprNodes
if self.lhs.type.is_pyobject:
self.rhs = self.rhs.coerce_to_pyobject(env)
- elif self.rhs.type.is_pyobject:
+ elif self.rhs.type.is_pyobject or (self.lhs.type.is_numeric and self.rhs.type.is_numeric):
self.rhs = self.rhs.coerce_to(self.lhs.type, env)
if self.lhs.type.is_pyobject:
self.result_value_temp = ExprNodes.PyTempNode(self.pos, env)
def test_large_int(double x):
"""
>>> test_large_int(0)
- 1e+100
+ 2e+100
"""
- return x + 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+ a = x + 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+ a += 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+ return a