Added check for math.h to prevent redefine of isnan and isinf