Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


atof()                   General Function                  atof()




Convert ASCII strings to floating point

double atof(string) char * string;

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 double.  It returns zero if you hand it a string that
it cannot interpret.






















COHERENT Lexicon                                           Page 1


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026