Better #ifdefs for NAN/INFINITY