Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wcstod.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wcstod.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wcstod.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wcstod.html on line 8
Convert a wide-character string into a double, float, or long double
#include <wchar.h>
double wcstod( const wchar_t * ptr,
wchar_t ** endptr );
float wcstof( const wchar_t * ptr,
wchar ** endptr );
long double wcstold( const wchar_t * ptr,
wchar ** endptr );
- nptr
- A pointer to the string to parse.
- endptr
- If this argument isn't NULL, the function stores in it a
pointer to the first unrecognized character found in the string.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
These functions convert a wide-character string to a number:
- wcstod() function converts it to a double
- wcstof() converts it to a float
- wcstold() to a long double.
These functions recognize strings containing the following:
- optional white space
- an optional plus or minus sign
- a sequence of digits containing an optional decimal point
- an optional e or E, followed by an optionally
signed sequence of digits.
The functions expect the string to have a plus or minus sign, followed by
one of these forms:
- A sequence of decimal digits, optionally followed by a radix character, optionally followed by an exponent part.
- A 0x or 0X followed by a sequence of hexadecimal digits, optionally followed by a radix character, optionally followed by a binary exponent part.
- The case-insensitive string INF or INFINITY.
- The case-insensitive string NAN or NAN(n-wchar-sequence) where n-wchar-sequence may be a digit, a nondigit, a n-wchar-sequence digit or a n-wchar-sequence nondigit.
The value is correctly rounded if the subject is hexadecimal and FLT_RADIX is 2.
The radix character is locale specific, depending upon LC_NUMERIC.
The conversion ends at the first unrecognized character.
If endptr isn't NULL, a pointer to the unrecognized
wide character is stored in the object endptr points to.
|
Because 0 is a valid return that is also used for an error, you should set
errno
to 0 before calling these functions, and check errno again
afterward.
These functions don't change errno on success. |
The converted value.
If the correct value would cause overflow, plus or minus
HUGE_VAL is returned according to the sign, and
errno is set to ERANGE.
If the correct value would cause underflow, then zero is returned, and
errno is set to ERANGE.
Zero is returned when the input string can't be converted.
When an error occurs, errno indicates the error detected.
ANSI,
POSIX 1003.1
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
errno
wcrtomb(),
wcsrtombs(),
wcstoimax(), wcstoumax(),
wcstok(),
wcstol(), wcstoll(),
wcstombs(),
wcstoul(), wcstoull(),
wctob(),
wctomb()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wcstod.html on line 202
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wcstod.html on line 202