atof(3C) atof(3C)NAME atof - converts an ASCII string to floating-point number SYNOPSIS double atof(nptr) char *nptr; DESCRIPTION atof converts a character string pointed to by nptr to a double-precision floating point number. The first unrecognized character ends the conversion. atof recognizes an optional string of white space characters (blanks or tabs), then an optional sign, then a string of digits optionally containing a decimal point, then an optional e or E followed by an optionally signed integer. If the string begins with an unrecognized character, atof returns the value zero. atof(str) is equivalent to strtod(str,(char **)NULL) STATUS MESSAGES AND VALUES When the correct value would overflow, atof returns HUGE, and sets errno to ERANGE. Zero is returned on underflow. SEE ALSO scanf(3S), strtod(3C), strtol(3C) January 1992 1