atof


Conversion of character string to floating-point number (double type)

[Classification]

Standard library

[Syntax]

#include <stdlib.h>

double atof(const char *str);

[Return value]

If the partial character string has been converted, the resultant value is returned. If the character string could not be converted, 0 is returned.

If an overflow occurs (the value is not in the range in which it can be expressed), HUGE_VAL or -HUGE_VAL is returned, and ERANGE is set to global variable errno. If an underflow occurs, 0 is returned, and macro ERANGE is set to global variable errno.

[Description]

This function converts the first portion of the character string indicated by str into a float type representation. atoff is the same as "strtod (str, NULL)".