Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctype(3C)

nl_init(3C)

scanf(3S)

hpnls(5)

lang(5)

strtold(3C)

NAME

strtold() − convert string to long double-precision number

SYNOPSIS

#include <stdlib.h>

long_double strtold(const char *str, char **ptr);

DESCRIPTION

strtold() returns as a long double-precision number the value represented by the character string pointed to by str. The string is scanned up to the first unrecognized character.

strtold() 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 radix character, then an optional e or E followed by an optional sign or space, followed by an integer.  The radix character is determined by the loaded NLS environment (see nl_init(3C)). If nl_init() has not been called successfully, the default NLS environment, "C" (see lang(5)), is used. The default environment specifies a period (.) as the radix character. 

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.

EXTERNAL INFLUENCES

International Code Set Support

Single-byte character code sets are supported. 

RETURN VALUE

If the correct value would cause overflow, +_MAXLDBL or -_MAXLDBL is returned (according to the sign of the value), and errno is set to ERANGE. 

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

AUTHOR

strtold() was developed by HP. 

SEE ALSO

ctype(3C), nl_init(3C), scanf(3S), hpnls(5), lang(5). 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

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