define INFINITY and NAN if they don't exist (#2929)