

atof()                   General Function                  atof()




Convert ASCII strings to floating point

ddoouubbllee aattooff(_s_t_r_i_n_g) cchhaarr * _s_t_r_i_n_g;

atof converts string  into the binary representation of a double-
precision  floating  point  number.   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 let-
ter `e' or `E' followed by  an optional leading sign and any num-
ber of decimal digits.  For example,


        123e-2


is a string that can be converted by atof.

atof ignores  leading blanks and tabs; it  stops scanning when it
encounters any unrecognized character.

***** Example *****

For an example of this function, see the entry for acos.

***** See Also *****

atoi(), atol(), float, general functions, long, printf(), scanf()

***** Notes *****

atof does  not check  to see if  the value represented  by string
fits into a ddoouubbllee.  It returns zero if you hand it a string that
it cannot interpret.






















COHERENT Lexicon                                           Page 1


