Commit d15e57b7 authored by Stefan Behnel's avatar Stefan Behnel

fixes for special float value constants (provided by Christian Heimes)

parent d97b5704
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment