06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

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

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

#include <br />

double atof(<br />

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

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

Notes<br />

This function converts the initial part of the string pointed to by nptr to a double<br />

representation. Leading white spaces are ignored. The argument nptr can be in<br />

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

stops parsing nptr when it detects a character inconsistent with a double data<br />

type. If the first nonwhite space character is other than a sign, a digit or a decimal<br />

point, a value of 0 is returned.<br />

Except for the behavior on error, this call is equivalent to:<br />

strtod(str, (char **)NULL);<br />

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

This function returns the converted value. In the event of an error, errno is set to<br />

indicate the condition.<br />

Refer to Appendix B.<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. Please refer to<br />

your compiler manual for the register pair. Additionally, if the FPU bit is set in the<br />

processor type entry of the Node Configuration Table, the pREPC+ library also<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 3-9<br />

3

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

Saved successfully!

Ooh no, something went wrong!