|
|
#include <stdlib.h>double strtod(const char *str, char **endptr);
The strtod function recognizes an optional string of ``white-space'' characters (as defined by isspace in ctype(S-osr5)), then an optional sign, then a string of digits optionally containing a decimal point, then an optional e or E followed by an optional sign or space, followed by an integer.
If the value of ptr is not (char )NULL, a pointer to the character terminating the scan is returned in the location pointed to by ptr. If no number can be formed, ptr is set to str, and zero is returned. If the correct value would cause overflow, ±HUGE_VAL (as defined in <math.h>) is returned (according to the sign of the value), and errno is set to ERANGE.
If the correct value would cause underflow, zero is returned and errno is also set to ERANGE.
X/Open Portability Guide, Issue 3, 1989
;
and
ANSI X3.159-1989 Programming Language -- C
.