HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)
s
strtold(3C) strtold(3C)
(TO BE OBSOLETED)
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 deter-
mined by the loaded NLS environment (see setlocale(3C)). If
setlocale() has not been called success-
fully, 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, positive
_LDBL_MAX or negative _LDBL_NMAX is returned
(according to the sign of the value), and errno is set to ERANGE. The _ _LDBL_MAX
and
_ _LDBL_NMAX macros are provided to assist in checking the return values against
_LDBL_MAX and
_LDBL_NMAX .
If the correct value would cause underflow, _ZERO is returned and errno is set to ERANGE.
WARNINGS
Obsolescent Interfaces
strtold() is to be obsoleted at a future date.
AUTHOR
strtold() was developed by HP.
SEE ALSO
ctype(3C), setlocale(3C), scanf(3S), lang(5), thread_safety(5).
Section 3−−934 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005