changed infinity to a math.h macro