strtod(3) CLIX strtod(3)
NAME
strtod - Converts a character string to a double precision number
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
double strtod(
char *str ,
char **ptr );
PARAMETERS
str A pointer to a character string.
ptr A pointer to the first unconverted character in str.
DESCRIPTION
The strtod() function returns as a double-precision floating-point number
the value represented by the character string pointed to by str. The
string is scanned up to the first unrecognized character.
The strtod() function recognizes an optional string of white space
characters (as defined in isspace(3)), 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.
Except for its behavior in the event of an error, the atof() function is
equivalent to strtod(str,(char **NULL)).
EXAMPLES
foo(string)
char *string
{
double DBL;
DBL = strtod(string, (char **)0);
DBL = atof(string);
}
RETURN VALUES
2/94 - Intergraph Corporation 1
strtod(3) CLIX strtod(3)
If a correct value causes overflow, +HUGE (as defined in <math.h>) is
returned (according to the sign of the value), and errno is set to ERANGE.
If a correct value causes underflow, zero is returned and errno is set to
ERANGE.
ERRORS
[ERANGE] The correct value results in either an overflow or underflow.
RELATED INFORMATION
Functions: atoi(3), atof(3), atol(3), ctype(3), isspace(3), scanf(3),
strtol(3), strtoul(3)
2 Intergraph Corporation - 2/94