From 0cb2cdb46d34206c813f49f04bb5f17e5556e5cf Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 27 May 2010 18:19:34 +0200 Subject: [PATCH] remember constant values during new constant node creation --- Cython/Compiler/ExprNodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.26.2