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

wcstod(3) Guardian Native C Library Calls Reference Manual
NAME
wcstod - Converts a wide-character string to a double-precision
oating-point value
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <wchar.h>
double wcstod(
const wchar_t * ws,
wchar_t **endptr);
PARAMETERS
ws Points to the wide-character string that is to be converted to a double-precision,
oating-point value.
endptr Points to a pointer in which the wcstod() function stores the position in the
string specied by ws where an unrecognized character is found.
DESCRIPTION
The wcstod() function converts the initial portion of the wide-character string pointed to by the
ws parameter to a double-precision, oating-point value. The input wide-character string is rst
broken down into three parts:
An initial (possibly empty) sequence of white-space, wide-character codes (as specied
by the iswspace() function).
A subject sequence interpreted as a oating-point constant.
A nal wide-character string of one or more unrecognized wide-character codes, includ-
ing the terminating null wide character.
The subject sequence is then, if possible, converted to a oating-point number and returned as
the result of the wcstod() function.
The subject sequence is expected to consist of the following:
An optional + (plus sign) or - (minus sign).
A nonempty sequence of digits, which may contain a radix character.
An optional exponent part, which consists of e or E, followed by an optional sign, fol-
lowed by one or more decimal digits.
The subject sequence is the longest initial subsequence of the input wide-character string, start-
ing with the rst non-white-space, wide-character code, that is of the expected form. The subject
sequence contains no wide-character codes if the input wide-character string is empty or consists
entirely of white-space, wide-character codes, or if the rst non-white-space, wide-character
code is not a sign, a digit, or a radix character.
If the subject sequence is valid, the sequence of wide-character codes, starting with the rst digit
or radix character, whichever occurs rst, is interpreted as a oating-point or double-precision,
oating-point constant. The locales radix character is treated as equivalent to the . (dot) within
oating-point constants in the C locale. If neither an exponent or radix character appears, a radix
character is assumed to follow the last digit in the wide-character string. If the subject sequence
768 Hewlett-Packard Company 527192-005