01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

STRTOD (3C) STRTOD (3C)<br />

NAME<br />

strtod, atof - convert string to double-precision number<br />

SYNOPSIS<br />

double strtod (str, ptr)<br />

char *str, **ptr;<br />

double atof (str)<br />

char *str;<br />

DESCRIPTION<br />

Strtod returns as a double-precision floating-point number, the<br />

value represented by the character string pointed to by str . The<br />

string is scanned up to the first unrecognized character.<br />

Strtod recognizes an optional string of "white-space" characters<br />

[as defined by isspace in ctype(3C)], then an optional sign, then a<br />

string of digits optionally containing a decimal point, then an<br />

optional e or E followed by an optional sign or space, followed by<br />

an integer.<br />

If the value of ptr is not (char **)NULL, a pointer to the character<br />

terminating the scan is returned in the location pointed to by ptr .<br />

If no number can be formed, *ptr is set to str, and zero is<br />

returned.<br />

Atof(str) is equivalent to strtod{str {char **)NULL} .<br />

SEE ALSO<br />

ctype(3C), scanf(3S), strtol(3C).<br />

DIAGNOSTICS<br />

If the correct value would cause overflow, =HUGE (as defined in<br />

) is returned (according to the sign of the value), and<br />

errno is set to ERANGE. If the correct value would cause<br />

underflow, zero is returned and errno is set to ERANGE.<br />

- 1 -

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

Saved successfully!

Ooh no, something went wrong!