Strtod - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Appendix A: System Routines — Utilities

strtod

Declaration:
double strtod (const char * nptr , char ** endptr )
Category(ies):
Utilities, Direct Floating Point Operations, Strings
Description:
Converts the initial portion of the string pointed to by nptr into a double
(BCD floating-point number), and if endptr is not a null pointer, sets the
character pointer pointed to by endptr to the address of the first character
following the set of characters converted.
The function skips leading whitespace, then accepts a sequence of
characters matching a floating-point constant. The expected format of the
floating-point constant consists of an optional sign character (+ or
LF_NEGATIVE), followed by a sequence of one or more decimal digits
optionally containing a decimal point, followed by an optional exponent.
The optional exponent consists of LF_EXPONENT, followed by an optional
sign, followed by one or more decimal digits.
If the first nonwhitespace character is not a sign, decimal digit or a decimal
point, the conversion fails. If the string contains an initial subset of the
optional exponent, and strtod reaches an unrecognized character before
scanning at least one decimal digit, the conversion fails.
Inputs:
nptr
endptr — Points to a character pointer that will contain the address of
Outputs:
Returns the converted double value (BCD floating-point number). If endptr
is not a null pointer, the object pointed to by it is assigned the address of
the first character of the string following the converted floating-point
number. If the conversion fails, zero is returned and * endptr is assigned
the value nptr .
If the result of the conversion would cause overflow, errno is set to
ERANGE and returns plus or minus DBL_MAX. If the result of the
conversion would cause underflow, errno is set to ERANGE and returns 0.
Assumptions:
None
Side Effects:
None
Availability:
On AMS 2.00 and higher.
TI-89 / TI-92 Plus
Differences:
None
TI-89 / TI-92 Plus Developer Guide
— String to convert.
the first character following the set of characters converted
when the function returns (or null).
(continued)
Not for Distribution
1109
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents