math: Fix INFINITY and NAN on FreeBSD and AIX. * doc/posix-headers/math.texi: Mention some FreeBSD and AIX bugs. * lib/math.in.h (INFINITY): New macro. (NAN): Replace also on FreeBSD < 8 and AIX. Use __builtin_nanf where available. (HUGE_VALF): Replace also on FreeBSD < 6. Use __builtin_inff where available. (HUGE_VAL): Replace also on FreeBSD < 6. Use __builtin_inf where available. (HUGE_VALL): Replace also on FreeBSD < 6. Use __builtin_infl where available. * tests/test-math.c: Check that INFINITY, NAN, HUGE_VALF, HUGE_VAL, HUGE_VALL are constant expressions. (main): Check the type of INFINITY and NAN.