Converts a string to double-precision value.
#include <stdlib.h> double strtod ( const char *ptr, char **endptr);
(IN) Points to the string to be converted.
(OUT) Points to the first unrecognized character.
If successful, returns the converted value. Otherwise, returns one of the following:
If the correct value causes overflow, returns plus or minus HUGE_VAL and sets errno to ERANGE. The sign of HUGE_VAL matches the sign of the value that cannot be represented.
If the correct value causes underflow, returns 0 and sets errno to ERANGE.
If the input string cannot be converted, returns 0 and sets errno to EINVAL.
The strtod function converts the string pointed to by ptr to double representation. The function recognizes a string containing:
Optional whitespace characters
An optional plus (+) or minus (-) sign
A sequence of digits containing an optional decimal point
An optional e or E followed by an optionally signed sequence of digits
The conversion ends at the first unrecognized character. A pointer to that character is stored in the object to which endptr points if endptr is not NULL.