11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Portabilitysrand con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See Also rand (page 301) RAND_MAX (page 302)strtolSynopsisDescriptionPortability#include double strtod(const char *nptr, char **endptr);strtod converts the initial portion of the string pointed to by nptr to a doublerepresentation.First, strtod decomposes the input string into three parts: an initial, possibly empty,sequence of white-space characters (as specified by isspace (page 246)), a subjectsequence resembling a floating-point constant, and a final string of one or moreunrecognized characters, including the terminating null character of the input string.strtod then attempts to convert the subject sequence to a floating-point number, andreturn the result.The subject sequence is defined as the longest initial subsequence of the input string,starting with the first non-white-space character, that is of the expected <strong>for</strong>m. Thesubject sequence contains no characters if the input string is empty or consists entirelyof white space, or if the first non-white-space character is other than a sign or apermissible letter or digit.The expected <strong>for</strong>m of the subject sequence is an optional plus or minus sign followedby a nonempty sequence of decimal digits optionally containing a decimal-pointcharacter, then an optional exponent part.If the subject sequence begins with a minus sign, the value resulting from theconversion is negated.A pointer to the final string is stored in the object pointed to by endptr, provided thatendptr is not a null pointer.If the subject sequence is empty or does not have the expected <strong>for</strong>m, no conversion isper<strong>for</strong>med, the value of nptr is stored in the object pointed to by endptr, provided thatendptr is not a null pointer.strtod returns the converted value, if any. If no conversion could be per<strong>for</strong>med, zero isreturned. If the correct value is outside the range of representable values, HUGE_VALis returned according to the sign of the value, if any, and the value of the macro errno(page 247) is stored in errno (page 247).strtod con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90).Chapter 28 - General utilities303

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!