The ISO C standard requires "INF" to be accepted by strtod: -- one of INF or INFINITY, ignoring case But in Turkish locales (LC_ALL=tr_TR.iso88599), where the lowercase 'I' is the dotless 'i', "INF" (or similar) is not recognized as the infinity. This can be seen with the following program and LC_ALL="tr_TR.iso88599". Tested under Debian with the libc6 2.3.5-4 package. #include <stdio.h> #include <stdlib.h> #include <locale.h> int main (void) { double x; char *end; int err; if (setlocale (LC_ALL, "") == NULL) { fprintf (stderr, "Can't set locales\n"); exit (EXIT_FAILURE); } x = strtod ("INF", &end); err = *end != '\0'; printf ("x = %f - error: %s\n", x, err ? "yes" : "no"); return err; }
Fixed in the current CVS trunk version.