Commit 679b58a6 authored by Robert Bradshaw's avatar Robert Bradshaw

More large literal as double fixes.

parent fb7cf01b
......@@ -4993,6 +4993,7 @@ class NumBinopNode(BinopNode):
return
if self.type.is_complex:
self.infix = False
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)
......
......@@ -3345,7 +3345,7 @@ class InPlaceAssignmentNode(AssignmentNode):
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)
......
......@@ -66,6 +66,8 @@ def test_complex(x):
def test_large_int(double x):
"""
>>> test_large_int(0)
1e+100
2e+100
"""
return x + 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
a = x + 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
a += 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
return a
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment