atof

Converts an ASCII character string to a double-precision number.

Format

#include  <stdlib.h>

double atof  (const char *nptr);

Argument

nptr
A pointer to the character string to be converted to a double- precision number. The string is interpreted by the same rules that are used to interpret floating constants.

Description

The string to be converted has the following format:
[white-spaces][+|-]digits[radix-character][digits][e|E[+|-]integer]

Where radix-character is defined in the current locale.

The first unrecognized character ends the conversion.

This function is equivalent to strtod(nptr, (char**) NULL).

Return Values
The converted value. 
Indicates an underflow or the conversion could not be performed. The function sets errno to ERANGE or EINVAL, respectively. 
(+/- )HUGE_VAL  Indicates overflow; errno is set to ERANGE. 


Previous Page | Next Page | Table of Contents | Index