Guardian C Library Calls Reference Manual

strtod
3-210 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
strtod
The strtod function converts the initial portion of a string to a double value.
str_ptr
points to the string to convert.
end_ptr_ptr
points to the variable of type pointer to char where strtod stores a pointer to the first
unrecognized character in *str_ptr.
Return Value
is the converted double value if the conversion is successful. If strtod could perform
no conversion, it returns zero. If the correctly converted value would cause overflow,
strtod returns positive or negative HUGE_VAL, depending on the sign of the value,
and sets errno to ERANGE (a range error). If the converted value would cause
underflow, strtod returns zero and sets errno to ERANGE.
Usage Guidelines
The strtod function scans for a valid floating-point constant, except that the constant
can have no float or long suffix.
The strtod function skips all leading space characters (as defined by isspace) in
*str_ptr.
The strtod function halts scanning when it encounters an unrecognized character.
#include <stdlibh>
double strtod(const char *str_ptr, char **end_ptr_ptr);