SilverScreen Solid Modeler

atof

atof

Previous topic Next topic  

atof

Previous topic Next topic JavaScript is required for the print function  

StandardCLibrary

 

double atof( char *s )

 

char *s;      /* string to be converted */

 

 

 




Synopsis

#include "stdlib.h"

 

The atof function returns the value of an ASCII text string representation of a floating point number. atof stops reading the input string at the first character that it cannot recognize as part of a number.

 

 

Parameters

s should be a null-terminated string with the following format:

 

     [whitespace][sign][digits][.digits][{e | E}[sign]digits]

 

where [whitespace] is a sequence of tab or space characters, [sign] is either plus ('+') or minus ('-'), and [digits] is one or more decimal digits.

 

 

Return Value

If s is empty, or no digits are found, or if the only digits found are in the exponent (i.e. following the e or E), then atof returns 0. If the result cannot be represented, then the return value is undefined.

 

 

See Also

atoi , atol , strtod