projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
172daf1
)
remember constant values during new constant node creation
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 27 May 2010 16:19:34 +0000
(18:19 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 27 May 2010 16:19:34 +0000
(18:19 +0200)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index b2f3dfea63888b85c6ef8c9d094a3be7f80b85d6..4f0129fac6e5b688a506037236435fdb7bf0219f 100755
(executable)
--- 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