Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ strtod(3C) — sys5 — Apollo Domain/IX SR9.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctype(3C)

scanf(3S)

strtol(3C)



STRTOD(3C)               DOMAIN/IX SYS5                STRTOD(3C)



NAME
     strtod, atof - convert string to double-precision number

USAGE
     double strtod(str, ptr)
     char *str, **ptr;

     double atof(str)
     char *str;


DESCRIPTION
     Strtod returns, as a double-precision floating-point number,
     the value represented by the character string that str
     points to.  The string is scanned up to the first unrecog-
     nized character.

     Strtod recognizes an optional string of "white-space" char-
     acters (as defined by isspace in ctype(3C)), then an
     optional sign, then a string of digits which may contain a
     decimal point, then an optional e or E followed by an option
     sign or space, followed by an integer.

     If the value of ptr is not (char **)NULL, a pointer to the
     character terminating the scan is returned in the location
     that ptr points to.  If no number can be set, *ptr is set to
     str, and zero is returned.

     Atof(str) is equivalent to strtod(str, (char**)NULL).

DIAGNOSTICS
     If the correct value would cause overflow, HUGE is returned,
     along with a sign to indicate the value, and errno is set to
     ERANGE.

     If the correct value would cause underflow, zero is returned
     and errno is set to ERANGE.

RELATED INFORMATION
     ctype(3C), scanf(3S), strtol(3C)













Printed 12/4/86                                          STRTOD-1





Typewritten Software • bear@typewritten.org • Edmonds, WA 98026