fixes for special float value constants (provided by Christian Heimes)
authorStefan Behnel <scoder@users.berlios.de>
Fri, 25 Apr 2008 16:20:05 +0000 (18:20 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 25 Apr 2008 16:20:05 +0000 (18:20 +0200)
Cython/Compiler/ExprNodes.py

index c2f5a475ef905b67718b5eec63accc56377c746b..8fb247230464844dd3c513b3af9bb03643e39528 100644 (file)
@@ -704,11 +704,11 @@ class FloatNode(ConstNode):
     def calculate_result_code(self):
         strval = str(self.value)
         if strval == 'nan':
-            return "NAN"
+            return "(Py_HUGE_VAL * 0)"
         elif strval == 'inf':
-            return "INFINITY"
+            return "Py_HUGE_VAL"
         elif strval == '-inf':
-            return "(-INFINITY)"
+            return "(-Py_HUGE_VAL)"
         else:
             return strval