Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ strtod(3C) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctype(3C)

scanf(3S)

strtol(3C)

hpnls(5)

langid(5)

STRTOD(3C)  —  HP-UX

NAME

strtod, atof, nl_strtod, nl_atof − convert string to double-precision number

SYNOPSIS

double strtod (str, ptr)
char ∗str, ∗∗ptr;

double atof (str)
char ∗str;

double nl_strtod (str, ptr, langid)
char ∗str, ∗∗ptr;
int langid;

double nl_atof (str, langid)
char ∗str;
inl langid;

DESCRIPTION

Strtod returns as a double-precision floating-point number the value represented by the character string pointed to by str. The string is scanned up to the first unrecognized character.

Strtod recognizes an optional string of “white-space” characters (as defined by isspace in ctype(3C)), then an optional sign, then a string of digits optionally containing a decimal point, then an optional e or E followed by an optional sign or space, followed by an integer. 

If the value of ptr is not (char ∗∗)NULL, the variable to which it points is set to point at the character after the last number, if any, that was recognized.  If no number can be formed, ∗ptr is set to str, and zero is returned.

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

Nl_strtod and nl_atof are similar to the above routines, but use langid to determine what the radix character should be, e.g. ’.’ or ’,’.  If langid is not valid, or information for langid has not been installed, the radix character defaults to a period. 

SEE ALSO

ctype(3C), scanf(3S), strtol(3C), hpnls(5), langid(5). 

DIAGNOSTICS

If the correct value would cause overflow, ±HUGE is returned (according to the sign of the value), and errno is set to ERANGE.  HUGE_VAL may be used instead of HUGE. 
If the correct value would cause underflow, zero is returned and errno is set to ERANGE. 

AUTHOR

Strtod was developed by AT&T Laboratories and the Hewlett-Packard Company. 

INTERNATIONAL SUPPORT

8-bit data, messages. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

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