From d15e57b71680ef87dfbc0f6f691e8db4374a5f55 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 25 Apr 2008 18:20:05 +0200 Subject: [PATCH] fixes for special float value constants (provided by Christian Heimes) --- Cython/Compiler/ExprNodes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index c2f5a475..8fb24723 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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 -- 2.26.2