From: Stefan Behnel Date: Fri, 25 Apr 2008 16:20:05 +0000 (+0200) Subject: fixes for special float value constants (provided by Christian Heimes) X-Git-Tag: 0.9.6.14~20^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d15e57b71680ef87dfbc0f6f691e8db4374a5f55;p=cython.git fixes for special float value constants (provided by Christian Heimes) --- 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