HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

s
strtod(3C) strtod(3C)
APPLICATION USAGE
To use (for Itanium-based systems)
strtow() or strtoq(), compile with the
-fpwidetypes option.
RETURN VALUE
If the correct value would cause overflow,
strtod() returns +/-HUGE_VAL (equal to +/-
INFINITY
), according to the sign of the value, and sets
errno to [ERANGE].
If the correct value would be nonzero but too small in magnitude to represent as a nonzero
double, then
strtod() returns zero and sets errno to [ERANGE]. For Itanium-based system,
strtod() also sets
errno to [ERANGE] whenever the conversion of its input parameter character string to
double raises
the underflow exception.
When the input parameter character string for
strtod()
, after the optional white space and sign, is
either
INF (case insensitive) or INFINITY (case insensitive)
strtod() will return +/-INFINITY,
according to the sign indicated by the character string.
When the input parameter character string for
strtod(), after the optional white space and sign, is NAN
(case insensitive),
strtod() will return a quiet NaN.
On Itanium-based systems, these functions round correctly for hexadecimal input strings, and round
correctly for up to 36 significant decimal digits, according to the specification in ISO/IEC C99.
SEE ALSO
ctype(3C), setlocale(3C), scanf(3S), strtol(3C), lang(5), thread_safety(5).
STANDARDS CONFORMANCE
strtod(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, ANSI C
atof(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
472 Hewlett-Packard Company 2 HP-UX 11i Version 2: December 2007 Update