HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
w
wcstod(3C) wcstod(3C)
NAME
wcstod() - convert wide character string to double-precision number
SYNOPSIS
#include <wchar.h>
double wcstod(const wchar_t *nptr, wchar_t **endptr);
Remarks:
This function is compliant with the XPG4 Worldwide Portability Interface wide-character formatting
functions. It parallels the 8-bit character formatting function defined in strtod(3C).
DESCRIPTION
wcstod() returns, as a double-precision floating-point number, the value represented by the wide charac-
ter string pointed to by nptr. The wide character string is scanned (leading white-space characters as
defined by iswspace() in wctype(3C) are ignored) up to the first unrecognized character. If no conver-
sion can take place, zero is returned.
wcstod() recognizes wide characters in the following sequence:
1. An optional string of ‘‘white-space’’ wide characters which are ignored,
2. An optional sign,
3. A string of digits optionally containing a radix character,
4. An optional e or E followed by an optional sign or space, followed by an integer.
The radix character is determined by the current NLS environment (see setlocale(3C)). If setlocale()
has not been called successfully, the default
NLS environment, "C", is used (see lang(5)). The default
environment specifies a period (.) as the radix character.
If the value of endptr is not
(wchar_t **)NULL, the variable to which it points is set to point at the
wide character after the last number, if any, that was recognized. If no number can be formed,
*endptr is
set to nptr, and zero is returned.
The definition for this function and the type
wchar_t are provided in the <wchar.h>header.
APPLICATION USAGE
wcstod() is thread-safe and async-cancel-safe.
EXTERNAL INFLUENCES
Locale
The LC_NUMERIC category determines the value of the radix character within the currently loaded NLS
environment.
The LC_CTYPE category determines how wide character codes are interpreted.
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
If the correct value would cause overflow, +HUGE_VAL or -HUGE_VAL 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.
If wcstod() encounters an input wide character string equal to inf or infinity (both case insensi-
tive) it will return HUGE_VAL.Ifwcstod() encounters an input wide character string equal to nan
(case insensitive) it will return _DNANQ.
AUTHOR
wcstod() was developed by AT&T and HP.
SEE ALSO
wctype(3C), setlocale(3C), scanf(3S), wcstol(3C), lang(5).
STANDARDS CONFORMANCE
wcstod(): XPG4
HP-UX Release 11i: December 2000 − 1 − Section 3−−1015
___
___