Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

wcstod(3) Guardian Native C Library Calls Reference Manual
begins with a - (minus sign), the conversion value is negated. The radix character is determined
by the LC_NUMERIC category in the programs current locale. In the C locale, or in a locale
where the radix character is not dened, the radix character defaults to a . (dot).
The wcstod() function stores a pointer to the nal wide-character segment of the string, starting
with the rst invalid character, in the object pointed to by the endptr parameter, unless the endptr
parameter is a null pointer.
NOTES
This function supports both IEEE Std 754-1985 oating-point and Tandem oating-point values
in the native environment. IEEE values can include NaN and innity, and the sign of 0.0 (zero)
can be either positive or negative. Refer to the fp_class(3) reference page for a description of
IEEE value classes.
Guardian functions are available to convert between oating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of oating-point conversions.
RETURN VALUES
The wcstod() function returns the converted value if a valid oating-point constant is found. If
no conversion could be performed, a value of 0.0 (zero) is returned and errno is set to [EIN-
VAL].
If the converted value is outside the range (either too high or too low), the variable errno is set to
[ERANGE]. In case of overow, plus or minus HUGE_VAL is returned. In the case of
underow, a value of 0.0 (zero) is returned. If the subject sequence is empty or does not have the
expected form, no conversion is performed. In this case, the value specied by the ws parameter
is stored in the object pointed to by the endptr parameter, provided that the endptr parameter is
not a null pointer.
Because the wcstod() function returns 0.0 (zero) or HUGE_VAL in the event of an error and
these values are also valid return values if the wcstod() function is successful, applications
should set errno to 0 (zero) before calling the wcstod() function and then check errno after
return from the function. If errno is nonzero, an error occurred. Additionally, if 0.0 (zero) is
returned, applications should check whether the endptr parameter equals the nptr parameter. In
this case, there was no valid subject string.
ERRORS
If the following condition occurs, the wcstod() function sets errno to the corresponding value:
[EINVAL] The converted value is an invalid numerical form.
[ERANGE] The converted value is outside the range of representable values.
RELATED INFORMATION
Functions: atof(3), fp_class(3), isnan(3), iswalnum(3), localeconv(3), scanf(3), setlocale(3),
wcstol(3).
STANDARDS CONFORMANCE
This function conforms to the XPG4 Version 2 specication when used for IEEE oating-point
format data.
774 Hewlett-Packard Company 527192-007