Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (s) strtod(3)
NAME
strtod - Converts a 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 and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdlib.h>
double strtod(
const char *nptr,
char **endptr
);
PARAMETERS
nptr Points to the character string to be converted.
endptr Points to a pointer in which the strtod( ) function stores the position in the string
specified by the nptr parameter where an invalid character is found.
DESCRIPTION
The strtod( ) function converts the initial portion of the string pointed to by the nptr parameter to
a double floating-point value. First the input string is decomposed into the following three parts:
• An initial, possibly empty, sequence of white-space characters (as specified by the
isspace( ) function for programs in the C/POSIX locale and the iswspace( ) function for
programs in other locales).
• A subject sequence interpreted as a floating-point constant.
• A final string of one or more unrecognized characters, including the terminating null byte
of the input string.
After decomposition of the string, the subject sequence is converted to a floating-point number,
and the resulting value is returned. A subject sequence is defined as the longest initial subse-
quence of the input string, starting with the first non-white-space character, that is of the
expected form.
The expected form and order of the subject sequence is an optional + (plus) or - (minus) sign,
followed by one of these:
• A nonempty sequence of decimal digits optionally containing a radix (decimal-point)
character, then an optional exponent part, which consists of e or E, followed by an
optional + (plus sign) or - (minus sign), followed by one or more decimal digits.
• For H-series RVUs and G06.27 and later G-series RVUs only, a 0x or 0X, then a
nonempty sequence of hexadecimal digits optionally containing a radix (decimal-point)
character, then an optional binary exponent part, which consists of p or P, followed by an
optional + (plus sign) or - (minus sign), followed by one or more decimal digits.
527187-017 Hewlett-Packard Company 6−173