06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

strtod pREPC+ <strong>System</strong> <strong>Calls</strong><br />

strtod Converts a string to a double.<br />

#include <br />

double strtod(<br />

const char *nptr, /* input string */<br />

char **endptr /* string conversion terminator */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Notes<br />

This function converts the initial portion of a string (nptr) to a double<br />

representation. Leading white spaces are ignored. The string can be in scientific<br />

exponential form (for example, +123.45e+67, -123.45E+67). The strtod() function<br />

stops parsing the string when it detects a character that is inconsistent with a<br />

double data type.<br />

This function sets errno if the converted value is out of the supported range for<br />

doubles.<br />

nptr Points to the string to be converted.<br />

endptr An output parameter. If nptr is null, strtod() functions the same<br />

as atof(). If nptr is not null, it points to a pointer to the character<br />

in str that terminated the scan.<br />

This function returns either the converted value or 0 if no conversion occurs. No<br />

conversion occurs if the first nonwhite space in str is neither a digit nor a decimal<br />

point. If the correct value is outside the range of representable values, a plus or<br />

minus HUGE_VAL is returned. If the correct value would cause underflow, 0 is<br />

returned. If either of these two errors occurs, errno is set.<br />

The pREPC+ library returns double values (including floating point) in the CPU<br />

register pair designated by the compiler to receive a return value of type double<br />

from a function call when a hardware floating point is not selected. Additionally, if<br />

3-164 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

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

Saved successfully!

Ooh no, something went wrong!