1ATOF(P) POSIX Programmer's Manual ATOF(P)
2
3
4
6 atof - convert a string to a double-precision number
7
9 #include <stdlib.h>
10
11 double atof(const char *str);
12
13
15 The call atof(str) shall be equivalent to:
16
17
18 strtod(str,(char **)NULL),
19
20 except that the handling of errors may differ. If the value cannot be
21 represented, the behavior is undefined.
22
24 The atof() function shall return the converted value if the value can
25 be represented.
26
28 No errors are defined.
29
30 The following sections are informative.
31
33 None.
34
36 The atof() function is subsumed by strtod() but is retained because it
37 is used extensively in existing code. If the number is not known to be
38 in range, strtod() should be used because atof() is not required to
39 perform any error checking.
40
42 None.
43
45 None.
46
48 strtod() , the Base Definitions volume of IEEE Std 1003.1-2001,
49 <stdlib.h>
50
52 Portions of this text are reprinted and reproduced in electronic form
53 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
54 -- Portable Operating System Interface (POSIX), The Open Group Base
55 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
56 Electrical and Electronics Engineers, Inc and The Open Group. In the
57 event of any discrepancy between this version and the original IEEE and
58 The Open Group Standard, the original IEEE and The Open Group Standard
59 is the referee document. The original Standard can be obtained online
60 at http://www.opengroup.org/unix/online.html .
61
62
63
64IEEE/The Open Group 2003 ATOF(P)