System Grab Bag

View all man pages from Linux (or from all projects)

Name

atof - convert a string to a double

Library

Standard C library ( libc ", " -lc )

Synopsis

#include <stdlib.h> 
double atof(const char * nptr );

Description

The atof() function converts the initial portion of the string pointed to by nptr to double. The behavior is the same as

strtod(nptr, NULL);

except that atof() does not detect errors.

Return Value

The converted value.

Attributes

For an explanation of the terms used in this section, see attributes(7). allbox; lbx lb lb T{ atof()
InterfaceAttributeValue
T}Thread safetyMT-Safe locale

Standards

C11, POSIX.1-2008.

History

POSIX.1-2001, C89, C99, SVr4, 4.3BSD.

See Also

  1. atoi(3),
  2. atol(3),
  3. strfromd(3),
  4. strtod(3),
  5. strtol(3),
  6. strtoul(3)