.\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" %sccs.include.redist.man% .\" .\" @(#)strtod.3 5.1 (Berkeley) %G% .\" .TH STRTOD 3 "" .UC 7 .SH NAME strtod \- convert ASCII string to double .SH SYNOPSIS .nf .ft B #include double strtod(const char *nptr, char **endptr); .ft R .fi .SH DESCRIPTION The .I strtod function converts the initial portion of the string pointed to by .I nptr to .I double representation. .PP The expected form of the string is an optional plus (``+'') or minus sign (``-''), followed by a sequence of digits optionally containing a decimal-point character, optionally followed by an exponent. An exponent consists of an ``E'' or ``e'', followed by an optional plus or minus sign, followed by a sequence of digits. .PP Leading white-space characters in the string (as defined by the .IR isspace (3) function) are skipped. .PP The .I strtod function returns the converted value, if any. .PP If .I endptr is not NULL, a pointer to the character after the last character used in the conversion is stored in the location referenced by .IR endptr . .PP If no conversion is performed, zero is returned and the value of .I nptr is stored in the location referenced by .IR endptr . .PP If the correct value would cause overflow, plus or minus .I HUGE_VAL is returned (according to the sign of the value), and .I ERANGE is stored in .IR errno . If the correct value would cause underflow, zero is returned and .I ERANGE is stored in .IR errno . .SH ERRORS .TP [ERANGE] Overflow or underflow occurred. .SH "SEE ALSO" atof(3), atoi(3), atol(3), strtol(3), strtoul(3) .SH STANDARDS .B Strtod conforms to ANSI X3.159-1989 (``ANSI C''). .SH BUGS This manual page represents intent instead of actual practice. The .IR strtod (3) function is not currently available.