.TH atof() "" "" "General Function (libc)"
.PC "Convert ASCII strings to floating point"
.B "#include <stdlib.h>"
\fBdouble atof(\fIstring\^\fB) char *\fI string\^\fB;\fR
.PP
.B atof
converts
.I string
into the binary representation of a double-precision floating point number.
.I string
must be the ASCII representation of a floating-point number.
It can contain a leading sign,
any number of decimal digits, and a decimal point.
It can be terminated with an exponent, which consists of the letter
.B \*(Qle\*(Qr
or
.B \*(QlE\*(Qr
followed by an optional
leading sign and any number of decimal digits.
For example,
.DM
	123e\-2
.DE
.PP
is a string that can be converted by
.BR atof() .
.PP
.B atof()
ignores leading blanks and tabs; it
stops scanning when it encounters any unrecognized
character.
.SH Example
For an example of this function, see the entry for
.BR acos() .
.SH "See Also"
.Xr atoi(), atoi
.Xr atol(), atol
.Xr float, float
.Xr libc, libc
.Xr long, long
.Xr printf(), printf
.Xr scanf(), scanf
.Xr stdlib.h stdlib.h
.br
\*(AS, \(sc7.10.1.1
.br
\*(PX Standard, \(sc8.1
.SH Notes
.B atof
does not check to see if the value represented by
.I string
fits into a \fBdouble\fR.
It returns zero if you hand it a string that it cannot interpret.
