Conversion of character string to floating-point number (double type) (storing pointer in last character string)
double strtod(const char *str, char **ptr);
If the partial character string has been converted, the resultant value is returned. If the character string could not be converted, 0 is returned.
If an overflow occurs (the value is not in the range in which it can be expressed), HUGE_VAL or -HUGE_VAL is returned, and ERANGE is set to global variable errno. If an underflow occurs, 0 is returned, and macro ERANGE is set to global variable errno.
This function converts the first part of the character string indicated by str into a float type representation. The part of the character string to be converted is in the following format and is at the beginning of str with the maximum length, starting with a normal character that is not a space.
[ + | - ] digits [ . ] [ digits ] [ (e | E) [ + | - ] digits ]
If str is vacant or consists of space characters only, if the first normal character is other than "+", "-", ".", or a numeral, the partial character string does not include a character. If the partial character string is vacant, conversion is not executed, and the value of str is stored in the area indicated by ptr. If the partial character string is not vacant, it is converted, and a pointer to the last character string (including the null character (\0) indicating at least the end of str) is stored in the area indicated by ptr.