wcstod()

convert wide character string to double-precision value 

Function


SYNOPSIS

#include <wchar.h>

double wcstod(const wchar_t *nptr, wchar_t **endptr);


DESCRIPTION

The wcstod() function converts the input string nptr into a double-precision value. The scanning stops at the first character that is not recognized as part of the number. This character can be the terminating NULL. This conversion occurs if a string of the expected form is passed in. The expected form consists of an initial, possibly empty, sequence of white-space characters, a sequence of characters interpreted as a floating-point constant, and a final sequence of wide characters that are not recognized as part followed by a terminating NULL character.

The sequence of characters that is interpreted as a floating-point constant must be of the following form. The expected form begins with an optional + or - character followed by a non-empty sequence of digits followed by an optional radix and an optional exponent part. The exponent part consists of an e or E followed by an optional sign and one or more digits.

The radix is defined by the program's locale, category LC_NUMERIC. In a locale where the radix is not defined or in the POSIX locale, the radix defaults to a period (.).


PARAMETERS

nptr 

Is the null-terminated pointer to convert.

endptr 

Points to the character that stops the scan.


RETURN VALUES

The wcstod() function returns the value of the double-precision floating-point number. In the case of an overflow the wcstod() function returns ±HUGE_VAL, where the sign of HUGE_VAL matches the sign of the value that could not be represented. If no conversion can be performed or if an underflow occurred then the wcstod() function returns 0. If the function fails, errno is set to one of the following values:

ERANGE 

An overflow occurred.

EINVAL 

The conversion could not be performed or an underflow occurred.


CONFORMANCE

ANSI/ISO 9899-1990/AM 1-1995.


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

This function is MT-Safe as long as no thread calls setlocale() while this function is executing.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
wcstol(), wcstoul()


MKS Toolkit 9.2 Documentation Build 16.