Embedded Artistry Framework
Embedded Systems C++ Framework
Functions
atof.c File Reference
#include <stdlib.h>
Include dependency graph for atof.c:

Functions

double atof (const char *ascii)
 Interprets a floating-point value in a byte string pointed to by str. More...
 

Function Documentation

◆ atof()

double atof ( const char *  str)

Interprets a floating-point value in a byte string pointed to by str.

Interprets a floating-point value in a byte string pointed to by str. Function discards any whitespace characters (as determined by

See also
isspace() until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating-point representation and converts them to a floating-point value. The valid floating-point value can be one of the following: 1) decimal floating-point expression. It consists of the following parts: a) (optional) plus or minus sign b) nonempty sequence of decimal digits optionally containing decimal-point character c) (optional) e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
Parameters
strpointer to the null-terminated byte string to be interpreted
Returns
double value corresponding to the contents of str on success. If the converted value falls out of range of corresponding return type, the return value is undefined. If no conversion can be performed, ​0​.0 is returned.

References NULL, and strtod().

Referenced by atof_test().

Here is the caller graph for this function: