From: Stefan Behnel Date: Thu, 27 May 2010 16:19:34 +0000 (+0200) Subject: remember constant values during new constant node creation X-Git-Tag: 0.13.beta0~63 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0cb2cdb46d34206c813f49f04bb5f17e5556e5cf;p=cython.git remember constant values during new constant node creation --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index b2f3dfea..4f0129fa 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -799,8 +799,9 @@ class IntNode(ConstNode): if self.type is dst_type: return self elif dst_type.is_float: - return FloatNode(self.pos, value=repr(float(self.value))) - node = IntNode(self.pos, value=self.value, + float_value = float(self.value) + return FloatNode(self.pos, value=repr(float_value), constant_result=float_value) + node = IntNode(self.pos, value=self.value, constant_result=self.constant_result, unsigned=self.unsigned, longness=self.longness) if dst_type.is_numeric and not dst_type.is_complex: return node