I recommend against using the constants from math.h. Python has some helpers in pyport.h (or pymath.h starting with 2.6):
inf = Py_HUGE_VAL -inf = -Py_HUGE_VAL nan = Py_HUGE_VAL * 0.
I recommend against using the constants from math.h. Python has some helpers in pyport.h (or pymath.h starting with 2.6):
inf = Py_HUGE_VAL
-inf = -Py_HUGE_VAL
nan = Py_HUGE_VAL * 0.