wcstod(3C) Standard C Library Functions wcstod(3C)
NAME
wcstod, wcstof, wcstold, wstod, watof - convert wide character string to floating-point number
SYNOPSIS
#include <wchar.h>
double wcstod(const wchar_t *restrict nptr, wchar_t **restrict endptr);
float wcstof(const wchar_t *restrict nptr, wchar_t **restrict endptr);
long double wcstold(const wchar_t *restrict nptr, wchar_t **restrict endptr);
double wstod(const wchar_t *nptr, wchar_t **endptr);
double watof(wchar_t *nptr);
DESCRIPTION
The wcstod(), wcstof(), and wcstold() functions convert the initial portion of the wide-character string pointed to by nptr to double,
float, and long double representation, respectively. They first decompose the input wide-character string into three parts:
1. An initial, possibly empty, sequence of white-space wide-character codes (as specified by iswspace(3C))
2. A subject sequence interpreted as a floating-point constant or representing infinity or NaN
3. A final wide-character string of one or more unrecognized wide-character codes, including the terminating null wide-character code of
the input wide-character string.
Then they attempt to convert the subject sequence to a floating-point number, and return the result.
The expected form of the subject sequence is an optional plus or minus sign, then one of the following:
o A non-empty sequence of decimal digits optionally containing a radix character, then an optional exponent part
o A 0x or 0X, then a non-empty sequence of hexadecimal digits optionally containing a radix character, then an optional binary exponent
part
o One of INF or INFINITY, or any other wide string equivalent except for case
o One of NAN or NAN(n-wchar-sequenceopt), or any other wide string ignoring case in the NAN part, where:
n-wchar-sequence:
digit
nondigit
n-wchar-sequence digit
n-wchar-sequence nondigit
In default mode for wcstod(), only decimal, INF/INFINITY, and NAN/NAN(n-char-sequence) forms are recognized. In C99/SUSv3 mode, hexadecimal
strings are also recognized.
In default mode for wcstod(), the n-char-sequence in the NAN(n-char-equence) form can contain any character except ')' (right parenthesis)
or '