466
|
1 <refentry id="atof">
|
|
2 <refnamediv>
|
564
|
3 <refname>Atof</refname>
|
|
4 <refname>Atoi</refname>
|
|
5 <refname>Atol</refname>
|
|
6 <refpurpose>ASCII to number conversions</refpurpose>
|
466
|
7 </refnamediv>
|
|
8
|
|
9 <refsynopsisdiv>
|
|
10 <funcsynopsis>
|
|
11 <funcprototype>
|
564
|
12 <funcdef>double <function>atof</function></funcdef>
|
|
13 <paramdef>char *<parameter>ptr</parameter></paramdef>
|
|
14 </funcprototype>
|
|
15
|
|
16 <funcprototype>
|
|
17 <funcdef>long <function>atol</function></funcdef>
|
|
18 <paramdef>char *<parameter>ptr</parameter></paramdef>
|
|
19 </funcprototype>
|
|
20
|
|
21 <funcprototype>
|
|
22 <funcdef>int <function>atoi</function></funcdef>
|
|
23 <paramdef>char *<parameter>ptr</parameter></paramdef>
|
466
|
24 </funcprototype>
|
|
25 </funcsynopsis>
|
|
26
|
|
27 </refsynopsisdiv>
|
|
28
|
|
29 <refsect1><title>Description</title>
|
|
30 <para>
|
564
|
31 Conversions of the string pointed to by "ptr" to the relevant
|
|
32 number type are carried out by these functions. They cease to
|
|
33 convert a number when the first unrecognized character is
|
|
34 encountered.
|
|
35 </para>
|
|
36 <para>
|
|
37 Each skips leading spaces and tab characters. Atof()
|
|
38 recognizes an optional sign followed by a digit string that
|
|
39 could possibly contain a decimal point, then an optional "e"
|
|
40 or "E", and optional sign and a digit string. Atol() and atoi()
|
|
41 recognize an optional sign and a digit string.
|
|
42 </para>
|
|
43 </refsect1>
|
|
44 <refsect1><title>Caveats</title>
|
|
45 <para>
|
|
46 Overflow causes unpredictable results. There are no error
|
|
47 indications.
|
466
|
48 </para>
|
|
49 </refsect1>
|
|
50 </refentry>
|