17 /* An interface to strtod that encapsulates all the error checking
18 one should usually perform. Like strtod, but return zero upon
19 successful conversion and put the result in *RESULT. Return
20 non-zero upon any failure. */
23 xstrtod (str, ptr, result)
34 val = strtod (str, &terminator);
36 /* Having a non-zero terminator is an error only when PTR is NULL. */
37 if (terminator == str || (ptr == NULL && *terminator != '\0'))
41 /* Allow underflow (in which case strtod returns zero),
42 but flag overflow as an error. */
43 if (val != 0.0 && errno == ERANGE)