'\"macro stdmacro
.if n .pH g3c.strtod @(#)strtod	40.12 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} strtod 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} strtod 3C "C Programming Language Utilities"
.if \nX=2 .ds x} strtod 3C "" "\&"
.if \nX=3 .ds x} strtod "" "" "\&"
.TH \*(x}
.SH NAME
\f4strtod\f1, \f4atof\f1, \- convert string to double-precision number
.SH SYNOPSIS
\f4#include <stdlib.h>\f1
.PP
\f4double strtod (const char \(**nptr, char \(**\(**endptr);\f1
.PP
\f4double atof (const char \(**nptr);\f1
.SH DESCRIPTION
\f4strtod\fP
returns as a double-precision floating-point number
the value represented by the character string pointed to by
.IR nptr .
The string is scanned up to the first unrecognized character.
.PP
\f4strtod\fP
recognizes an optional string of ``white-space'' characters
[as defined by
\f4isspace\fP
in 
\f4ctype\fP(3C)],
then an optional sign, then
a string of digits optionally containing a decimal
point character, then an optional exponent part including an 
\f4e\f1 or \f4E\f1
followed by an optional sign, followed by an integer.
.PP
If the value of
.I endptr\^
is not \f4(char \(**\(**)NULL\fP,
a pointer to the character terminating the scan is returned in
the location pointed to by
.IR endptr .
If no number can be formed,
.I \(**endptr\^
is set to
.IR nptr ,
and zero is returned.
.PP
\f4atof(nptr)\fP is equivalent to:
.br
	\f4strtod(nptr, (char \(**\(**)NULL)\fP.
.SH SEE ALSO
\f4ctype\fP(3C), \f4scanf\fP(3S), \f4strtol\fP(3C).
.SH DIAGNOSTICS
If the correct value
would cause overflow,
\f4\(+-HUGE\f1
is returned
(according to the sign of the value),
and
.I errno\^
is set to
\f4ERANGE\f1.
.br
If the correct value would cause underflow,
zero
is returned
and
.I errno\^
is set to
\f4ERANGE\f1.
.br
When the \f4\-Xc\f1 or \f4\-Xa\f1 compilation options are used, 
\f4HUGE_VAL\f1
is returned instead of 
\f4HUGE.\f1
'\"	@(#)strtod.3c	6.7 of 4/2/84
.Ee
