fix nan/infinity macros in math.h, etc.