Commit | Line | Data |
---|---|---|
1bfb2659 | 1 | .\" @(#)atof.3 6.1 (Berkeley) %G% |
f11907db | 2 | .\" |
1bfb2659 | 3 | .TH ATOF 3 "" |
f11907db KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | atof, atoi, atol \- convert ASCII to numbers | |
7 | .SH SYNOPSIS | |
8 | .nf | |
9 | .B double atof(nptr) | |
10 | .B char *nptr; | |
11 | .PP | |
12 | .B atoi(nptr) | |
13 | .B char *nptr; | |
14 | .PP | |
15 | .B long atol(nptr) | |
16 | .B char *nptr; | |
17 | .fi | |
18 | .SH DESCRIPTION | |
19 | These functions convert a string pointed to by | |
20 | .I nptr | |
15a002cb | 21 | to floating, integer, and long integer representation respectively. |
f11907db KM |
22 | The first unrecognized character ends the string. |
23 | .PP | |
24 | .I Atof | |
15a002cb | 25 | recognizes an optional string of spaces, then an optional sign, then |
f11907db | 26 | a string of digits optionally containing a decimal |
15a002cb | 27 | point, then an optional `e' or `E' followed by an optionally signed integer. |
f11907db KM |
28 | .PP |
29 | .I Atoi | |
30 | and | |
31 | .I atol | |
15a002cb KM |
32 | recognize an optional string of spaces, then an optional sign, then a |
33 | string of | |
f11907db KM |
34 | digits. |
35 | .SH SEE ALSO | |
15a002cb | 36 | scanf(3S) |
f11907db KM |
37 | .SH BUGS |
38 | There are no provisions for overflow. |