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
floating-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,
floating-point value.
endptr Points to a pointer in which the wcstod() function stores the position in the
string specified 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, floating-point value. The input wide-character string is first
broken down into three parts:
• An initial (possibly empty) sequence of white-space, wide-character codes (as specified
by the iswspace() function).
• A subject sequence interpreted as a floating-point constant.
• A final 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 floating-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 first 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 first 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 first digit
or radix character, whichever occurs first, is interpreted as a floating-point or double-precision,
floating-point constant. The locale’s radix character is treated as equivalent to the . (dot) within
floating-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
7−68 Hewlett-Packard Company 527192-005