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