+ {
+ /* Check for infinities and NaNs. */
+ if (c_tolower (*s) == 'i'
+ && c_tolower (s[1]) == 'n'
+ && c_tolower (s[2]) == 'f')
+ {
+ s += 3;
+ num = HUGE_VAL;
+ if (c_tolower (*s) == 'i'
+ && c_tolower (s[1]) == 'n'
+ && c_tolower (s[2]) == 'i'
+ && c_tolower (s[3]) == 't'
+ && c_tolower (s[4]) == 'y')
+ s += 5;
+ goto valid;
+ }
+#ifdef NAN
+ else if (c_tolower (*s) == 'n'
+ && c_tolower (s[1]) == 'a'
+ && c_tolower (s[2]) == 'n')
+ {
+ s += 3;
+ num = NAN;
+ /* Since nan(<n-char-sequence>) is implementation-defined,
+ we define it by ignoring <n-char-sequence>. A nicer
+ implementation would populate the bits of the NaN
+ according to interpreting n-char-sequence as a
+ hexadecimal number, but the result is still a NaN. */
+ if (*s == '(')
+ {
+ const unsigned char *p = s + 1;
+ while (c_isalnum (*p))
+ p++;
+ if (*p == ')')
+ s = p + 1;
+ }
+ goto valid;
+ }
+#endif
+ goto noconv;
+ }